Forum Discussion

MarieAmell's avatar
MarieAmell
Frequent Visitor
3 years ago
Solved

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 : _Top N Ad...
  • amitchandak's avatar
    3 years ago

    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 (€)])

  • MarieAmell's avatar
    3 years ago

    Hi amitchandak , thanks a lot for your help !

    The 2nd measure you proposed works.

    Thanks again, have a nice day