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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
shekhar_shres
Advocate II
Advocate II

Return Blank Value if a Slicer is selected

Hi everyone,

I hope you are all doing great. I want to make a Measure goes blank if a slicer is selected but I am only half way there. 

I have dimRegion Table as below:
RegionState RegionState ID

RegionState ID
Region AA1
Region BB1
Region CC1
Region XX2
Region YY2
Region ZZ2

 

And I have StateTable which is connected to Region Table above with State ID

StateIDState
1VIC
2NSW


Also, I have as staff cost table (factTable) as below.

StateIDMetricAmount
1Staff Cost500

 

The problem is Staff Cost is allocated on State Level and not the Region Level. So, I want to make sure that my measure
(StaffCost = sum(StaffCost[Amount]) )goes blank or 0 when someone selected Region Slicer in Power BI.

I tried using following dax

StaffCostDynamic = IF(HASONEVALUE(dimRegion[Region]),blank(), [StaffCost]))

So far, the above dax works if someone selects only one Region (Say Region AA) in the slicer. but as soon as someone selects two Region in the Slicer (Say Region AA and Region BB) then the actual value appears (In our example $500). 

What dax should I write to ensure that the StaffCostDynamic Measure goes blank when someone selected Region Slicer. 


Your help will be highly appreciated. 

Kind regards,






1 ACCEPTED SOLUTION
vicky_
Super User
Super User

You could try using ISFILTERED(dimRegion[Region]) instead of HASONEVALUE() in your if statement.

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

You could try using ISFILTERED(dimRegion[Region]) instead of HASONEVALUE() in your if statement.

Exactly what I needed.


Thank you

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors