Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
Hi,
I want to create 4 time series graph that represent the rank 1, rank 2, rank 3 and rank 4.
I tried several ways with no success.
First I make a measure for the scrap quantity produced:
ThenI make the ranking, which works apparently fine in a table:
| Proceso | Merma Kg | Rank Procesos Merma |
| Proceso 5 | 20963 | 1 |
| Proceso 4 | 18781 | 2 |
| Proceso 10 | 17537 | 3 |
| Proceso 3 | 13558 | 4 |
| Proceso 2 | 10493 | 5 |
| Proceso 1 | 9671 | 6 |
| Proceso 7 | 9342 | 7 |
| Proceso 9 | 8122 | 8 |
| Proceso 6 | 2750 | 9 |
| Proceso 8 | 1272 | 10 |
Solved! Go to Solution.
Your rank will be calculated on different filter contexts. Process 5 is only #1 overall, but not for the individual rows. So you would have to do two steps
- find the process that is ranked #1 overall
- show the items for that process.
Merma Rank 1 =
var a = summarize(ALLSELECTED(Merma),[Proceso],"sm",[Merma Kg])
var b = maxx(TOPN(1,a,[sm]),[Proceso])
return calculate([Merma Kg],Merma[Proceso]=b)
For Rank 2 you need to do some extra gymnastics
Merma Rank 2 =
var a = summarize(ALLSELECTED(Merma),[Proceso],"sm",[Merma Kg])
var b = maxx(TOPN(1,TOPN(2,a,[sm]),[sm],ASC),[Proceso])
return calculate([Merma Kg],Merma[Proceso]=b)
Your rank will be calculated on different filter contexts. Process 5 is only #1 overall, but not for the individual rows. So you would have to do two steps
- find the process that is ranked #1 overall
- show the items for that process.
Merma Rank 1 =
var a = summarize(ALLSELECTED(Merma),[Proceso],"sm",[Merma Kg])
var b = maxx(TOPN(1,a,[sm]),[Proceso])
return calculate([Merma Kg],Merma[Proceso]=b)
For Rank 2 you need to do some extra gymnastics
Merma Rank 2 =
var a = summarize(ALLSELECTED(Merma),[Proceso],"sm",[Merma Kg])
var b = maxx(TOPN(1,TOPN(2,a,[sm]),[sm],ASC),[Proceso])
return calculate([Merma Kg],Merma[Proceso]=b)
Thank you, it worked perfect. I appreaciate very much your help.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 30 | |
| 28 | |
| 25 | |
| 24 | |
| 16 |
| User | Count |
|---|---|
| 48 | |
| 32 | |
| 17 | |
| 16 | |
| 16 |