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

How to form a DAX between a table and the selected value in the slicer

Hi, 

 

I'm new to Power BI, and I'm stuck with the below issue

 

I have a table, say A. and I have a slicer , which dropdowns all the employee nums in the table A. Now I need to create a measure where, the table with all records are displayed and based the employee number selected in the slicer, for that particular row in table that row needs to be highlighted. 

 

The employee number in the slicer changes everytime when the table is refreshed. Please help

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create a calculated table based on the employee column in the fact table.

 

Slicer = VALUES(Table1[employee])

Create a measure as below and make the visual formatted by it as the picture.

 

Measure = 
VAR _list =
    VALUES ( 'Slicer'[employee] )
RETURN
    SWITCH ( TRUE (), MAX ( Table1[employee] ) IN _list, "#34da22" )

 

Capture.PNG

 

Pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create a calculated table based on the employee column in the fact table.

 

Slicer = VALUES(Table1[employee])

Create a measure as below and make the visual formatted by it as the picture.

 

Measure = 
VAR _list =
    VALUES ( 'Slicer'[employee] )
RETURN
    SWITCH ( TRUE (), MAX ( Table1[employee] ) IN _list, "#34da22" )

 

Capture.PNG

 

Pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @Anonymous ,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.