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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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