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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
suziecameron
Regular Visitor

Using a filter from a different table to hilight a related column

I have created a simplified version of a visual where I can select an employee from a staff list in the first table, and I can see the other employees based in (1) the same team, and (2) the same location as the selected employee:

Full Table:

suziecameron_0-1693846706725.png

Filtered Table:

suziecameron_0-1693847138255.png

I would like to be able to hilight the selected employee's row in the Team and Location tables respectively, something like this: 

suziecameron_1-1693847192250.png

However, because of the way I have set up the relationships, I cannot find a way to do it.

 

This is the model view:

suziecameron_2-1693846929544.png

The "Teams" and "Locations" are Dimension Tables, and the logic for the "Team Table" and the "Loc Table" are as follows:

 

Team Table =
SUMMARIZE('Employees','Employees'[Team],'Employees'[ID])
 
Loc Table =
SUMMARIZE('Employees','Employees'[Location],'Employees'[ID])
 
Does anyone have any suggestions on how to improve this set-up? Many thanks
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @suziecameron ,

 

Here are the steps you can follow:

1. Create measure.

Location_color =
var _select=
SELECTEDVALUE('Employee Table'[Location])
var _count=
COUNTX(ALLSELECTED('Employee Table'),'Employee Table'[Location])
return
IF(
HASONEFILTER('Employee Table'[Location])=FALSE(),BLANK(),
IF(
    MAX('Location DimTable'[Location])=_select,"red",
    BLANK())
)
team_color =
var _select=
SELECTEDVALUE('Employee Table'[Team])
return
IF(
HASONEFILTER('Employee Table'[Team])=FALSE(),BLANK(),
IF(
    MAX('Team DimTable'[Team])=_select,"yellow",
    BLANK())
)

2. Place [Location_color] into Location DimTable Visual and select [Location] - Conditional Formatting - Background Colour.

vyangliumsft_0-1695286386408.png

vyangliumsft_1-1695286386412.png

3. Place [team_color] into Team DimTableVisual and select [team] - Conditional Formatting - Background Colour.

vyangliumsft_2-1695286456003.png

4. Result:

vyangliumsft_3-1695286456004.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi  @suziecameron ,

 

Here are the steps you can follow:

1. Create measure.

Location_color =
var _select=
SELECTEDVALUE('Employee Table'[Location])
var _count=
COUNTX(ALLSELECTED('Employee Table'),'Employee Table'[Location])
return
IF(
HASONEFILTER('Employee Table'[Location])=FALSE(),BLANK(),
IF(
    MAX('Location DimTable'[Location])=_select,"red",
    BLANK())
)
team_color =
var _select=
SELECTEDVALUE('Employee Table'[Team])
return
IF(
HASONEFILTER('Employee Table'[Team])=FALSE(),BLANK(),
IF(
    MAX('Team DimTable'[Team])=_select,"yellow",
    BLANK())
)

2. Place [Location_color] into Location DimTable Visual and select [Location] - Conditional Formatting - Background Colour.

vyangliumsft_0-1695286386408.png

vyangliumsft_1-1695286386412.png

3. Place [team_color] into Team DimTableVisual and select [team] - Conditional Formatting - Background Colour.

vyangliumsft_2-1695286456003.png

4. Result:

vyangliumsft_3-1695286456004.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hello @Anonymous 

Thank you so much for your assistance here, I am very grateful!

The problem I am encountering is that in the DimTableVisual, I would like to see the full list of employees in that [loaction] or [team], with only the selected ID highlighted.

So assuming ID '7' was selected, as in your screenshot, in the DimLocation visual I would want to see a list of all IDs related to Location '2' (ie. IDs '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '21'), with ID '7' highlited. In the DimTeam visual I would was to see a list of all IDs related to Team 'A' (ie. IDs '1', '2', '3', '4', '5', '6', '7', '8'), with ID '7' highlited.

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Thank you @lbendlin

 

Employee Table:

IDTeamLocation

1A1
2A1
3A1
4A2
5A2
6A2
7A2
8A2
9A2
10B2
11B2
12B2
13B2
14B2
15B4
16B3
17B3
18C3
19C3
20C3
21C2
22C1
23C1
24C1

 

Location DimTable:

Location

1
2
4
3

 

Team DimTable:

Team

A
B
C

 

The desired result is that I can select/filter for a specific employee from my 'Employees' table, and I can see a full list of other employees in that employee's team and location respectively, but with the selected/filtered employee highlighted or marked in some way for readability, for example:

suziecameron_0-1694433305227.png

 

I would happily share the full .pbix file, but I don't know how to do it since I can't attach it.

Thanks again for the help

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.