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
Dilbertfan
Frequent Visitor

Highlight Table Rows from Selection in Another Table

Hi All

 

I have an issue with highlight rows in a table which I havent been able to find a suitable answer to from the various posts on highlighting rows using disconnected tables.

 

The Data

I have two tables - one for Employee and one for Topic, with a 1-Many relationship between them

 

Dilbertfan_0-1744009163376.png  Dilbertfan_1-1744009182454.png  Dilbertfan_2-1744009192943.png

 

The Ask

I would like to be able to select an Organisation which should show all of the disctinct topics for that organisation in a table and the employees in another table.  However, I would then like the user to be able to click on the employee name and for it to highlight the topics that they are interested in - something like the following layout.

 

Dilbertfan_3-1744009443419.png

So if Bob was clicked, Mental, Cycling and Yoga would be highlighted.  I dont want to use a filter on the Topic table (which would be the easy way out) as I want to see continually see all of the topics for the organisation.

 

I have tried various combinations of the suggestions by Goodly and Valerie Junk from YouTube, but to no available.

 

If necessary, I am happy for the name to be in a slicer visual, as I can use the tile slicer to add in their job description which I havent shown on the data table.

 

Hope this is enough information.  A sample pbix file is attached

 

Highlight Test File 

 

Thanks in anticipation for your help

 

Rich

1 ACCEPTED SOLUTION

@Dilbertfan  I had another think about this and tried to solve the exact thing you wanted.
Now I don't know how scaleable this will be but I did get it working.

First I created a measure that would read who the orginisation was and force every possible Topic they might have to show. To make this neat I deleted the column header and set the measure to return an empty string "".

Then I read the row and checked which person had been clicked in the table and if their topic matched the row set it to yellow.

SamWiseOwl_0-1744026977474.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

5 REPLIES 5
SamWiseOwl
Super User
Super User

 

Hi @Dilbertfan 

 

You need a second copy of the employee list and use this to read which Name the report user has clicked.

Then change the colour based on a measure:

SamWiseOwl_0-1744013186309.png

Highlight row measure =
 VAR CurrSlicer = SELECTEDVALUE('Employee Table'[Selected Name]) --chosen person in slicer
 var filtTopics =
 CALCULATETABLE(VALUES(Topics[Topic]), Employee[Name] = CurrSlicer) --what hobbies does that person like

 RETURN
 IF(
    SELECTEDVALUE(Topics[Topic]) IN filtTopics --if current row in list then change colour
    ,"Yellow" --apply yellow or use hex codes to get specific colours #00FF00 would be green
 )

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

@Dilbertfan  I had another think about this and tried to solve the exact thing you wanted.
Now I don't know how scaleable this will be but I did get it working.

First I created a measure that would read who the orginisation was and force every possible Topic they might have to show. To make this neat I deleted the column header and set the measure to return an empty string "".

Then I read the row and checked which person had been clicked in the table and if their topic matched the row set it to yellow.

SamWiseOwl_0-1744026977474.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Hi @SamWiseOwl 

 

Thanks very much for taking the time to respond - really appreciate it.

 

Yes this works great and I understand the rationale behind the Force Measure.

 

The only minor hiccup is that when you select a individual, say Sally in Tesco, if you then switch to Waitrose, the topics are blank until you click on Fred because it still thinks it should be based on Sally from Tesco who doesn't exist in Waitrose.  However, this is minor issue and similar to the slicer issue when values remain in another slicer

 

Could this be used with a Button Slicer to select the employee rather than a table?

 

Anyway, I can move forward with this now - so fanastic bit of help.  Going to have a lot of fun documenting the 2 measures 😀

 

Rich

antfr99
Resolver II
Resolver II

Hi @Dilbertfan 

I suggest this measure :

IsSelectedEmployeeTopic =
VAR SelectedEmp = SELECTEDVALUE(Employee[Emp ID])
RETURN
IF (
    MAX(Topic[Emp ID]) = SelectedEmp,
    1,
    0
)

with this formatting in Cell Elements :


Cell Elements.png

 

which should give you this result :

Result.png

 

 

Regards

Antonio

Hi @antfr99 

 

Thanks very much indeed for taking the time to respond.

 

This is a great solution, but not quite right for what I need.  This shows all the topics regardless of what organisation you select, but I want the topics to be filtered by the organisation., but then highlighted by the employee.

 

However, I am definitely keeping this one in my back pocket for other use cases.  Love the simplicity of it.

 

Rich

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.