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

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
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.