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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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