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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Custom Hierarchy for Map Visual.

Hi All,

So, my problem is that I have lats and longs of 600+ locations and I want to group these under :
1) 4 zones - East, West, North, and South.

2) 30+ towns 

3) Location, true to Lat and Long.

 

Then I want to display these 4 zones on a map visual and be able to drill down to town and then to location.

For example: If I select West Zone, the map should drill down to all the towns in west zone, then when I select a town, the map should show me all the locations under that town(from the lats and longs in the data).


Thanks in Advance 🙂

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a simple sample to test:

20.PNG

Then i define the Zone and Town's policy by creating calculated columns:

 

Zone = 
SWITCH (
    TRUE,
    'Table'[Latitude] > -50
        && 'Table'[Latitude] < -0
        && 'Table'[Longitude] > -100
        && 'Table'[Longitude] < -50, "South",
    'Table'[Latitude] > 30
        && 'Table'[Latitude] < 50
        && 'Table'[Longitude] > 70
        && 'Table'[Longitude] < 120, "East",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -50
        && 'Table'[Longitude] < 0, "North",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -200
        && 'Table'[Longitude] < -150, "West"
)
Zone = 
SWITCH (
    TRUE,
    'Table'[Latitude] > -50
        && 'Table'[Latitude] < -0
        && 'Table'[Longitude] > -100
        && 'Table'[Longitude] < -50, "South",
    'Table'[Latitude] > 30
        && 'Table'[Latitude] < 50
        && 'Table'[Longitude] > 70
        && 'Table'[Longitude] < 120, "East",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -50
        && 'Table'[Longitude] < 0, "North",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -200
        && 'Table'[Longitude] < -150, "West"
)

 

When you choose Zone and Town as slicer, it shows all the locations of Town and Zone:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

2 REPLIES 2
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a simple sample to test:

20.PNG

Then i define the Zone and Town's policy by creating calculated columns:

 

Zone = 
SWITCH (
    TRUE,
    'Table'[Latitude] > -50
        && 'Table'[Latitude] < -0
        && 'Table'[Longitude] > -100
        && 'Table'[Longitude] < -50, "South",
    'Table'[Latitude] > 30
        && 'Table'[Latitude] < 50
        && 'Table'[Longitude] > 70
        && 'Table'[Longitude] < 120, "East",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -50
        && 'Table'[Longitude] < 0, "North",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -200
        && 'Table'[Longitude] < -150, "West"
)
Zone = 
SWITCH (
    TRUE,
    'Table'[Latitude] > -50
        && 'Table'[Latitude] < -0
        && 'Table'[Longitude] > -100
        && 'Table'[Longitude] < -50, "South",
    'Table'[Latitude] > 30
        && 'Table'[Latitude] < 50
        && 'Table'[Longitude] > 70
        && 'Table'[Longitude] < 120, "East",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -50
        && 'Table'[Longitude] < 0, "North",
    'Table'[Latitude] > 50
        && 'Table'[Latitude] < 100
        && 'Table'[Longitude] > -200
        && 'Table'[Longitude] < -150, "West"
)

 

When you choose Zone and Town as slicer, it shows all the locations of Town and Zone:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

Greg_Deckler
Super User
Super User

Hmm, well Location will accept a hierarchy in the standard map visuals but I don't think it will recognize east, west, etc.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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