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
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

 

Share with Power BI Enthusiasts: 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
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