Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
luiz_borges
Frequent Visitor

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

filter.pngWhat 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 2
slounsbury
Helper II
Helper II

Hi @luiz_borges 

 

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?

 


@slounsbury wrote:

Hi @luiz_borges 

 

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.