Forum Discussion
Top N Legend on a Time series Line chart with field parameter
rintoalappat , Create region sale
Region sales = calculate(sum(Orders[Sales]), Filter(ALLSELECTED(Orders), Orders[Region]= max(Orders[Region])))
Then use this measure in visual
Switch Sales = var _selected = maxx(FILTER('Select Dim', 'Select Dim'[Select Dim Order] = SELECTEDVALUE('Select Dim'[Select Dim Order])), 'Select Dim'[Select Dim])
return
Switch( _selected,
"Customer", sum(Orders[Sales]),
"Region",CALCULATE(Sum(Orders[Sales]), KEEPFILTERS(TOPN(5, ALLSELECTED(Orders[Region]),[Region sales],DESC))))
File is attached
Thank you and appreciate you time on this solution.
I was trying and found there are few more steps: (please check the highlighted)
1, Showing Top 5 based on "Profit" when selecting Field Parameter "Customer", should show everything when selecting "Region".
Note : on line graph, we are showing "Sales" measure but Top N needs to find based on "Profit"
I missed to enter this in my first post. Could you please try with this modification and let me know. Thanks in advance