Hello Muhammad,
I would suggest using reference selectors and changing your domain model to something like:
Entity - Building (with name string attribute)
Entity - Flat (with name string attribute)
Association - One Building to Many flats
Once you create the right buildings and flats and associate them to each other you should be able to navigate through the flats in a building.
Also see: https://docs.mendix.com/refguide/reference-selector
Hope this helps.