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
Anonymous
Not applicable

Measure to Calculate if Slicer matches record

I am trying to create a new measure which will determine if a record matches a value in a slicer table.

 

If I have three records in table Z used to populate the Slicer with records A,B,C.  

Then I would like to create a measure in table Y to determine if column 1 = a value selected in the slicer.

 

i.e. If Column1.value = Slicer.Selectedvalue then "y" else "n"

 

 

5 REPLIES 5
KHorseman
Community Champion
Community Champion

Is the slicer table disconnected from the records table? That is, there is no relationship between the two tables? If so this is easy.

 

Assuming they are disconnected and you are displaying every row from the records table individually, this will wok.

 

Measure = IF( FIRSTNONBLANK(RecordTable[Column1], 1) = FIRSTNONBLANK(SlicerTable[SlicerColumn], 1), "y", "n")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks for the suggestion.

Yes the slicer table is "unrelated" to the record table.

I tried your suggestion and it works if a single record is selected in the slicer table, but when multiple items are selected it only selects the "FirstNonBlank" which may or may not be the correct value to select.

Anyone else with further suggestions?

 

Are you saying you want it to check if each record value equals any of multiple selected values in the slicer?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

yes that's correct.

Hi @Anonymous,

Please try the CONTAINS function. Please use the formula below and check if it works fine.

result=IF(CONTAINS(SlicerTable, ALLSELECTED(SlicerTable[SlicerColumn]), FIRSTNONBLANK(RecordTable[Column1], 1)),"yes","No")


Best Regards,
Angelia

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.