Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
MilczacaOwca
New Member

Maps: visualise and filter data from different tables

Hi,

 

I want to visualise on map Stores and it's competitors.

In fact table  (dispalyed as visual table) we store information about Store and it's competitor during an event.

When I select in slicer Fair I want to see localisation of Stores and Competitors in map (with different color on map)

 

I've already did additional table "Map" that combines (UNION) Stores and Competitors with additional column "Type", but I struggle how to make relations. Dimention tables are connced with relation 1:N with fact table.

 

Any idea how to solve this?

 

I have factTable

StoreId
CompetitorId
EventId
FairId

And dimension tables

StoreTable
---------
StoreId
StoreName
Longitude
Latitude

CompetitorTable
---------
StoreId
StoreName
Longitude
Latitude

EventTable
---------
EventId
EventName

FairTable
--------
FairId
FairName

 

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@MilczacaOwca  I think you need to Unpivot StoreID and CompetitorID in your Fact table. 

 

Then you'll have:

Fact Table: 

FairID | EventID | Type | StoreCompID

 

Your UNION (in Power Query we call it 'append') of Competitor and Store tables is correct - are the IDs unique in these? If not, you'll need to merge columns Type and StoreCompID to get a unique ID in both tables: https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_11.html

 

Your new UNION table should have:

StoreCompID | Store Name | Lat | Long | Type

where Type is Competitor or Store

 

Then create a new measure:

 

[FactTransactions] = COUNTROWS(FactTable)

 

Put that in the Size of a map visual and put the UNIONdim[Type] in the legend and the UNIONdim Lat and Long in the lat long fields of the map.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

@MilczacaOwca  I think you need to Unpivot StoreID and CompetitorID in your Fact table. 

 

Then you'll have:

Fact Table: 

FairID | EventID | Type | StoreCompID

 

Your UNION (in Power Query we call it 'append') of Competitor and Store tables is correct - are the IDs unique in these? If not, you'll need to merge columns Type and StoreCompID to get a unique ID in both tables: https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_11.html

 

Your new UNION table should have:

StoreCompID | Store Name | Lat | Long | Type

where Type is Competitor or Store

 

Then create a new measure:

 

[FactTransactions] = COUNTROWS(FactTable)

 

Put that in the Size of a map visual and put the UNIONdim[Type] in the legend and the UNIONdim Lat and Long in the lat long fields of the map.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.