Forum Discussion
Show Top N *filtered* values in graph
Hi all,
pls have a look at the following graph :smileyhappy:
x-axis is date, y-axis are stacked values of the sum of top 5 categories + "Other".
Basically my source data is the following:
Date | Value | Category
I achieved the upper graph by creating columns
- ValueSum=CALCULATE(SUM(Salden[Value]);ALLEXCEPT(Salden;Salden[Category]))
- Rank = RANKX(ALL(Salden);[ValueSum];;DESC;Dense)
- and finally Top5Category = IF([Rank]<=5;Salden[Category];"Other")
Problem: this works nicely if no filter is applied to the graph like (show only 2017). If I apply a filter, the categories obviously remain the same.
My Question: I would like the Top N categories to be based on the data that is actually shown in the graph. Meaning if I filter the graph to show only values from 2017, the Top N categories should be the ones of 2017 and not of the whole time range.
I know who to do this if I'm showing "only" a table using measures... but I can't use measures in the graph...
Any suggestion/solution?
BR, Anton
4 Replies
- v-chuncz-msft
Community Support
- AntonEmFrequent Visitor
v-chuncz-msft: hm my problem is, that I can't use measures as legend in the graph... it's just not possible to drag measures in to the according field.
I assume I have to find a solution which relies on calculations!?
- AntonEmFrequent Visitor
Any other suggestions? :smileyhappy:
- AntonEmFrequent Visitor
No one has a suggestion? Maybe a "this is just not possible" ;)