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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sandyteenan
Frequent Visitor

Hide data in a matrix if zero required filters are set

Hi all,

I have 2 tables with a 1-many relationship. The filter on the 1 side is set to "require single selection", but it's possible to unselect all which causes all data to be displayed. Leaving aside the insanity of this implementation 😋, how can I hide all data if zero filters are selected? HASONEFILTER in a measure gives me the information I need but a visual level filter on that measure (IsFIlteredCorrectly in the screenshot) will not allow me to specify filter out anything - (All) is the only option.

 

sandyteenan_0-1681384537505.png

Is there a way to do this?

1 ACCEPTED SOLUTION

Thanks for the pointer @amitchandak - for the purposes of the demo above, the measure should be :

IsFilteredCorrectly = if(CALCULATE(HASONEVALUE('Population'[IsCapital]),ALLSELECTED()) , 1,0)
 
Which correctly displays nothing if all filter values for IsCapital are unchecked and only the subset of rows if one of the filter values is selected 👍

View solution in original post

3 REPLIES 3
sandyteenan
Frequent Visitor

 Data for Capital table : 

 

IsCapital
1
0

 

Data for Population table : 

CountryCityIsCapitalPopulation
EnglandLondon16000000
EnglandManchester03000000
ScotlandEdinburgh1600000
ScotlandGlasgow01000000

@sandyteenan ,  Try a measure like this and check in the visual level filter if that 1

Measure = if(CALCULATE(HASONEVALUE('Table'[IsCapital]),ALLSELECTED()) && Maxx(ALLSELECTED('Table'[IsCapital]), 'Table'[IsCapital])=0, 0,1)

 

 

 

I have done that on brand id

 

Measure = if(CALCULATE(HASONEVALUE('Item'[Brand]),ALLSELECTED()) && Maxx(ALLSELECTED('Item'[Brand Id]), 'Item'[Brand Id])=1, 0,1)
 
amitchandak_0-1681393818596.png

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the pointer @amitchandak - for the purposes of the demo above, the measure should be :

IsFilteredCorrectly = if(CALCULATE(HASONEVALUE('Population'[IsCapital]),ALLSELECTED()) , 1,0)
 
Which correctly displays nothing if all filter values for IsCapital are unchecked and only the subset of rows if one of the filter values is selected 👍

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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