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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
amos_jevons
Regular Visitor

Filter visuals based on slicer selection's parent category

I want users to be able to select an item from a slicer and see a report for all items in the same category.

 

I have a table similar to this:

 

COUNTRY   | REGION         | POPULATION      | OECD_MEMBER
Australia | Oceania | 24,000,000 | True
Austria | Europe | 8,747,000 | True
Belgium | Europe | 11,350,000 | True
China | Asia | 1,379,000,000 | False
Ecuador | South America | 16,390,000 | False
Fiji | Oceania | 898,760 | False 

 

Each REGION can contain multiple COUNTRIES but a country can only be in one region.

 

I want users to select an entry from the COUNTRY column and see the population of its REGION, stacked by OECD_MEMBER status. For instance, selecting AUSTRALIA would show a bar for OCEANIA with 96% under TRUE (representing Australia) and 4% under FALSE (representing Fiji). 

 

I have created a slicer for COUNTRY but I cannot figure out how to set a visual filter based on the selected country's REGION.

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

Hi amos_jevons,

 

To achieve your requirement, create a measure using dax formula below:

Result = 
VAR region = CALCULATE(MAX(Table1[REGION]), FILTER(ALL(Table1), Table1[COUNTRY] = SELECTEDVALUE(Table1[COUNTRY])))
VAR total = CALCULATE(SUM(Table1[POPULATION]), FILTER(ALL(Table1), Table1[REGION] = region))
return
CALCULATE(MAX(Table1[POPULATION]), FILTER(ALL(Table1), Table1[COUNTRY] = SELECTEDVALUE(Table1[COUNTRY]))) / total

Capture.PNGCapture2.PNG 

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi amos_jevons,

 

To achieve your requirement, create a measure using dax formula below:

Result = 
VAR region = CALCULATE(MAX(Table1[REGION]), FILTER(ALL(Table1), Table1[COUNTRY] = SELECTEDVALUE(Table1[COUNTRY])))
VAR total = CALCULATE(SUM(Table1[POPULATION]), FILTER(ALL(Table1), Table1[REGION] = region))
return
CALCULATE(MAX(Table1[POPULATION]), FILTER(ALL(Table1), Table1[COUNTRY] = SELECTEDVALUE(Table1[COUNTRY]))) / total

Capture.PNGCapture2.PNG 

 

Regards,

Jimmy Tao

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.