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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
billuran
Helper I
Helper I

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
billuran
Helper I
Helper I

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 @billuran , 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

@billuran , 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])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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