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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Add true or false in table if slicer is selected

I am in urgent need of help following hours of searching!

 

I have two tables:

 

Table:

TermNameResult
T1Name12
T2Name14
T3Name26
T3Name38

 

Unrelated slicer table:

Name
Name1
Name2
Name3

 

What I want to do:

  • Select a name in the slicer
  • Create a measure to add to the main table to show a true if the name is selected.

 

I have tried a few formulas, but I think they are falling over where there are multiple rows. 

 

Help would be greatly appreciated. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,  Try a measure like 

 

Measure =

calculate(count(*), filter(Table, table[Name] in values(Table2[Name])))+0

 

refer my video on this -https://www.youtube.com/watch?v=lOEW-YUrAbE

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,  Try a measure like 

 

Measure =

calculate(count(*), filter(Table, table[Name] in values(Table2[Name])))+0

 

refer my video on this -https://www.youtube.com/watch?v=lOEW-YUrAbE

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thanks for such a swift and helpful reply @amitchandak 

Will try this out it looks more elegant than the one I just found:

Measure =
VAR __T =VALUES(Slicer[Name])
RETURN
IF(__T in VALUES(Table[Name]) , TRUE(), FALSE())

@Anonymous , Try like

 

Measure =
VAR __T =VALUES(Slicer[Name])
RETURN
IF(Table[Name] in _T , TRUE(), FALSE())
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.