Forum Discussion
Filter selected users (obtained from one filter selection) and extend data to this user group
- 5 years ago
Hi, patricia_csf
According to your description, I think that you want to get the count of categories of color which is linked to the selected users, you can try my method:
This is my test data:
- Create a calculated table ‘Slicer’:
Slicer = SUMMARIZE('Table',[Color])- Create a measure [Count of color by selected users]:
Count of color by selected users = var _selectedcolor=SELECTEDVALUE(Slicer[Color]) var _Filter1=SELECTCOLUMNS(FILTER('Table',[Color]=_selectedcolor),"User",[User]) var _Filter2=SELECTCOLUMNS(FILTER('Table',[User] in _Filter1),"Color",[Color]) var _summarize=SUMMARIZE(_Filter2,[Color]) return COUNTX(_summarize,[Color])- Create a Slicer(place ‘Slicer’[Color]) and a card chart and place the measure created before, and you can get what you want, like this:
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
patricia_csf , what is the option you have used.
Have used a color measure with field option -
Colour =
SWITCH(TRUE(),
'Table'[Date] < TODAY(), "red",
'Table'[Date] = TODAY(), "orange",
"green")
Colour =
SWITCH(TRUE(),
max('Table'[Month Year]) = "Jan-2020", "red",
Max('Table'[Month Year]) < "Feb-2020", "orange",
//keep on adding
"green")
Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)
refer steps
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Hi, actually I mentioned "blue color", but this could be city name instead. It is not related to coloring the table, but about data filtering for a parameter that I called as "blue color". But, maybe easier to give the example as "city". Let's assumed I filtered "New York", and I have the data for this city and for all cities. What is missing is that I want to know "from the users that visited New York, which other cities they have also visited". In my color example, it would be as "from the users that had values for blue color, only for this group, what was the total color values (blue + green + yellow... + 200 other colors )". It is clear now? And thx for the quick answer.