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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rkouwenhoven
Frequent Visitor

Top 10 customers in linechart

I have created a Top 10 measure based on number of orders per customer. This works fine, however I want to see the development of each customer by week. If I use the same measure used in the table I do get a nice linechart but the numbers are slightly different. It makes sense because the Top 10 is based on a total but could generate a different Top 10 by week. I'm basically looking for a fixed Top 10 based on a date selection and have it shown in a line chart as well.

 

First of all I made a RANKX measure:

RANK = RANKX(
ALL(DimRelation[relationgroup]),
[# Orders],
,DESC)
 
To get the Top 10 list I used below measure:
# Orders Top 10 = IF(
ISFILTERED(DimRelation[relationgroup]),
IF(
[RANK] <= 10,
[# Orders],
BLANK()),
CALCULATE(
[# Orders], TOPN(10,VALUES(DimRelation[relationgroup]),[# Orders])
))

 

Anyone able to help me out?

3 REPLIES 3
amitchandak
Super User
Super User

@rkouwenhoven , If you create Rank relationgroup and use week or date with it. It will be rank inside week/Date

 

Try like

RANK = RANKX(
Summarize(Table, DimRelation[relationgroup], Date[Week]),
[# Orders],
,DESC)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak There's a way to solve it in the specific visual by using the total orders as a value [# Orders] and filter on the relaion group by Top N. This works and give the correct number in the visual. However the challenge is, I also need the same visuals for the "non" Top 10, so everything but the Top 10. I'm not able to solve that through the general filter. 

 

It means there must be a way within a DAX function but I can't see how.

rkouwenhoven_0-1620994121396.png

 

It's not doing the magic yet. I keep getting the same results.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.