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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Conditional Measure Based on Available Field Values

Hi, Simplistic version; I have 3+ facilities. 2 Of the facilities (FacA & FacB) do not report the data I want to show so I have to show a different measure when they are selected.

Facilities are stored in Table Facilities. Named as FacilitiesName

Measure A if any of the 2 facilities are filtered. 

 

Measure B if neither of the 2 are selected.

 

And to note the 2 facilities could be filtered through RLS not by slicer. So whena user logs on they may just have those 2 facilities available or a user could use slicer to filter to those 2 fields.

3 REPLIES 3
Anonymous
Not applicable

Thank you. but its not giving me the second measure 

Follow Up Switch = if(isfiltered(Facility[Facility_Name]) && countx(filter(Facility,Facility[Facility_Name] in {"FACA" ,"FACB"}),Facility[Facility_Name])+0>1, [Date Since Worked],[Compliance %])

Hi @Anonymous , can you show your expected result with some dummy data? It seems [Date Since Worked] should return date data type and [Compliance %] should return decimal number data type. This may cause a problem because you can set only a format for the conditional measure.

amitchandak
Super User
Super User

@Anonymous , Try a new measure like

 

if(isfiltered(Facilities[FacilitiesName]) && countx(filter(Facilities,Facilities[FacilitiesName] in {"FacA" ,"FacB"}),Facilities[FacilitiesName])+0>1, [Measure A],[Measure B])

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors