Forum Discussion
Using a filter from a different table to hilight a related column
- Anonymous3 years ago
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.
3. Place [team_color] into Team DimTableVisual and select [team] - Conditional Formatting - Background Colour.
4. Result:
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
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-Forum/ba-p/963216
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/1447523
Thank you @lbendlin
Employee Table:
IDTeamLocation
| 1 | A | 1 |
| 2 | A | 1 |
| 3 | A | 1 |
| 4 | A | 2 |
| 5 | A | 2 |
| 6 | A | 2 |
| 7 | A | 2 |
| 8 | A | 2 |
| 9 | A | 2 |
| 10 | B | 2 |
| 11 | B | 2 |
| 12 | B | 2 |
| 13 | B | 2 |
| 14 | B | 2 |
| 15 | B | 4 |
| 16 | B | 3 |
| 17 | B | 3 |
| 18 | C | 3 |
| 19 | C | 3 |
| 20 | C | 3 |
| 21 | C | 2 |
| 22 | C | 1 |
| 23 | C | 1 |
| 24 | C | 1 |
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:
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