cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidbrown100 Regular Visitor
Regular Visitor

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 Super Contributor
Super Contributor

Re: Measure to Calculate if Slicer matches record

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? Please mark it as a solution.

Proud to be a Datanaut!
davidbrown100 Regular Visitor
Regular Visitor

Re: Measure to Calculate if Slicer matches record

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?

 

KHorseman Super Contributor
Super Contributor

Re: Measure to Calculate if Slicer matches record

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? Please mark it as a solution.

Proud to be a Datanaut!
davidbrown100 Regular Visitor
Regular Visitor

Re: Measure to Calculate if Slicer matches record

yes that's correct.

v-huizhn-msft Super Contributor
Super Contributor

Re: Measure to Calculate if Slicer matches record

Hi @davidbrown100,

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
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 379 members 3,258 guests
Please welcome our newest community members: