Forum Discussion
Getting Group/Attributes of a Filtered Item
Hi ats1958,
I have found an awesomeblog which may could help you achieve your idea output.
You could have a good look at this blog Highlighting Scatter Charts in Power BI using DAX.
Best Regards,
Cherry
- ats19588 years ago
Helper II
I don't think this is quite what I need.
In the example, the dots in the scatter plot aren't changing, one is just being highlighted.
What I'm looking to do is display a subset of the data in the chart.
An example would be, if I have a list of cities, states, and populations, and a user selects "San Francisco," I'd want the chart to show all the cities in the California with their populations. And San Francisco would be highlighted in that chart.
- OwenAuger8 years ago
Super User
Here is a mock-up of what I think you are looking for.
This could be done a number of ways depending on your existing tables, and my mock-up could well be adapted/simplified.
- Add an Employee Filter table, containing a single column of Employee names, with an inactive relationship to your fact table.
- Create a measure Selected Employee Flag, which returns 1 if the currently visible Employees include those selected in the Employee Filter table (intended to be used only when filtering on individual Employees).
Selected Employee Flag = VAR EmployeesSelected = CALCULATETABLE ( VALUES ( Data[Employee] ), USERELATIONSHIP ( Data[Employee], 'Employee Filter'[Employee Filter] ), ALL ( Data ) ) RETURN IF ( NOT CALCULATE ( ISEMPTY ( VALUES ( Data[Employee] ) ), KEEPFILTERS ( EmployeesSelected ) ), 1 ) - Create another measure Selected Employee Department Flag which returns 1 if the currently visible Departments include those of the Employees selected in the Employee Filter table.
Selected Employee Department Flag = VAR DepartmentSelected = CALCULATETABLE ( VALUES ( Data[Department] ), USERELATIONSHIP ( Data[Employee], 'Employee Filter'[Employee Filter] ), ALL ( Data ) ) RETURN IF ( NOT CALCULATE ( ISEMPTY ( VALUES ( Data[Employee] ) ), KEEPFILTERS ( DepartmentSelected ) ), 1 ) - Create your visual (at an Employee level of detail), and add a Visual Level Filter "Selected Employee Department=1"
- Put the Selected Employee Flag in Color Saturation, and tweak colours as needed.
- If multiple Employees are selected, they will all be highlighted with relevant Departments shown.
Regards,
Owen
- ats19588 years ago
Helper II
OwenAuger This is close. However, I'm using a DirectQuery dataset with Power BI Embedded with RLS. Additionally, end users are uploading their own data to my database. Meaning that adding a new table creates a ton of headaches. Is there a workaround that doesn't involve another table?
Thanks