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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ys034
Helper I
Helper I

Create geographical hierarchy

my data looks like this:

ys034_0-1663154547074.png

 

I have market shares for countries as well as consolidated regions. My "problem" is that we have all the data in the same column

I would like to create a hierarchy that is structured as follows:

World = World
EU = France, Germany, Russia, Turkey, Ukraine, United Kingdom
WEU = France, Germany, United Kingdom
EEU = Turkey, Ukraine, Russia

 

in the best case the filter should look like this

 

ys034_1-1663154546818.png

 

 

 

 

At the end, the market shares should not be aggregated when filtering, but should refer to the market share provided in the column. Is there any solution? I would be grateful for any answer.

 

thanks in advance!

1 REPLY 1
GregMarbais
Kudo Collector
Kudo Collector

Hey @ys034 ,

Others may have different ideas. But if I were tackling this, I would see if the datasource could suppress the subtotal rows AND you don't have an attribute table somewhere that ties countries to the World > Region > Subregion hierarchy. If not, I would use Power Query to delete the aggregate rows in the data. Then I would add a columns for the region evaluation.

1. Add Custom Column that just sets the entry to "World" If you really do need this level

 

2. Add a Custom Column or Calculated Column to add the Region (EU)

Table.AddColumn(#"Changed Type1", "Hierarchy Region", each if List.Contains( {"France", "Germany", "Russia", "Turkey", "Ukraine", "United Kingdom"}, [Region]) then "EU" else if List.Contains( {"United States", "Canada", "Mexico"},[Region]) then "NA" else null, type text)

 

3. Add one for the Sub-Region that would generate the column for the sub-region EEU or WEU

Table.AddColumn(#"Region 1", "Hierarchy Sub Region", each if List.Contains( {"Russia", "Turkey", "Ukraine"}, [Region]) then "EEU" else if List.Contains( {"France", "Germany", "United Kingdom"}, [Region]) then "WEU" else if List.Contains( {"United States", "Canada", "Mexico"},[Region]) then "NA" else null, type text)

 

In my example above, I created an entry for North America so I could highlight the script for additional regions.

Here's what it would look like in Power Query with just the data you posted above:

GregMarbais_0-1663157780395.png

 

Then close and apply and you can create your hierarchy in the Field well. And that will let you turn on and off the subtotals at the visual level.

Hope this helps!

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.

Top Solution Authors