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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Anonymous
Not applicable

Show top 10 Sales percent differences In Trend Chart or Sparkline

Can someone direct me to how I can create either a table with Location Codes and show only the top 10 Locations with YOY Sales Percent changes OR a Trend Line that has all 10 Locations in it?

 

My Table is something like

Location    Date    Sales

A               1/1/19    100

A                1/1/18    50

 

 

Then I would want to see Location A with +50 sales ranked as 1 and then others below that.

 

This seems like it should be so easy but is proving to be difficult.  

 

I currently have a RANKX function but PBI doesn't let me filter by it in my views.  Which would have made my life easier.  

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create rank column like DAX below.

 

Rank= RANKX(FILTER(Table1 ,Table1 [Location]=EARLIER(Table1 [Location])),Table1 [Sales],, Asc, Dense)

 

Then create a measure named Filter1, then put measure Filter1 in the Visual Level Filter of goal visual, and setting the Filter1 as "is not blank".

 

Filter1= IF(MAX(Table1[Rank])<=10, 1, BLANK())

 

7.png

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create rank column like DAX below.

 

Rank= RANKX(FILTER(Table1 ,Table1 [Location]=EARLIER(Table1 [Location])),Table1 [Sales],, Asc, Dense)

 

Then create a measure named Filter1, then put measure Filter1 in the Visual Level Filter of goal visual, and setting the Filter1 as "is not blank".

 

Filter1= IF(MAX(Table1[Rank])<=10, 1, BLANK())

 

7.png

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Can't the RANKX measure be filtered by "Less then equal to" 10?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.