Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Rankx with top N visual Filter

Im new to power BI and DAX and I searched everywhere and couldnt find a solution for my problem.


My problem is that Im trying to rank stores by the amount they sold in the year and Im using this formula

rankx = RANKX(ALL(resumo_consolidada[Loja]);[Faturamento];;;Dense)

this formula works fine and rank all the stores, but i just want to see the top 20 so when I use the TOP N visual filter to show only the top 20, the ranks changes like the img below

What change should I make in the formula so when I use the TOPN Visual filter the ranks dont change?

Im filtering the top 20 by using the calculated measure [faturamento] that is just a sum of the values.

2 Replies

  • Hi Anonymous 

     

    If I understand correctly....can you add the "amount each store sold" field to the visual level filters and sort by TopN top 20 that way?

     

    If not, can you provide a sample report that has that issue?

    • Anonymous's avatar
      Anonymous
      Not applicable

       


      slounsbury wrote:

      Hi Anonymous 

       

      If I understand correctly....can you add the "amount each store sold" field to the visual level filters and sort by TopN top 20 that way?

       

      If not, can you provide a sample report that has that issue?


      Hmm, when I was creating the sample file for you I noticed that the error wasnt happening in the sample so when I looked to my report and removed a report level filter that I made the ranks stayed the same when I placed the top N visual filter.

       

      Sorry for creating this topic but I never tought that a date report level filter could mess with this function.