Forum Discussion
TopN Slicer with legends
Hi All,
I'd like to add a slicer to display the top 5, 10, 20 or All of my advertisers.
- I have created a table "TopN_Value" as follow :
- Then, I created the measure :
- It works when I have only spends by advertisers :
- But when I want to add a legend, it doesn't work anymore :
If someone could explain to me what's wrong and how I can correct that, it would be awesome !
Thanks a lot
MarieAmell , when use legend with TOPN , that will topN Inside that legend.
Use a visual level filter of TOPN
or
Try measures like
_Top N Adv = sumx(keepfilters( TOPN(TopN_Value[Valeur N_value], ALL('Data'[Advertiser],'Data'[legend column] ), [_Spends (€)])), [_Spends (€)])
_Top N Adv = sumx(keepfilters( TOPN(TopN_Value[Valeur N_value], ALL('Data'[Advertiser] ), calculate([_Spends (€)], removefilters('Data'[legend column])) )), [_Spends (€)])
Hi amitchandak , thanks a lot for your help !
The 2nd measure you proposed works.
Thanks again, have a nice day
2 Replies
- amitchandak
Super User
MarieAmell , when use legend with TOPN , that will topN Inside that legend.
Use a visual level filter of TOPN
or
Try measures like
_Top N Adv = sumx(keepfilters( TOPN(TopN_Value[Valeur N_value], ALL('Data'[Advertiser],'Data'[legend column] ), [_Spends (€)])), [_Spends (€)])
_Top N Adv = sumx(keepfilters( TOPN(TopN_Value[Valeur N_value], ALL('Data'[Advertiser] ), calculate([_Spends (€)], removefilters('Data'[legend column])) )), [_Spends (€)])
- MarieAmellFrequent Visitor
Hi amitchandak , thanks a lot for your help !
The 2nd measure you proposed works.
Thanks again, have a nice day