Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have a table, created with
| 32 | 627 | 15312,92 |
| 65 | 627 | 12334,53 |
| 72 | 3765 | 11182,11 |
| 98 | 3765 | 11115,84 |
| 27 | 627 | 11004,35 |
| 86 | 627 | 9992,141 |
| 27 | 65 | 9637,937 |
| 66 | 627 | 9196,524 |
| 84 | 29 | 7751,839 |
| 48 | 65 | 7737,647 |
| 23 | 25 | 7304,194 |
| 26 | 74 | 7213,433 |
I would need to create a rank of the customer. Same customer has the same rank based on the total sales of all the time.
Thanks.
Solved! Go to Solution.
Hi @Nun
you can achieve this by adding a calculated column to your table using the following DAX:
rank =
RANKX(
ALL( table_name ),
CALCULATE(
SUM( table_name[Total Sales] ),
ALL( table_name ),
table_name[Customer] = EARLIER( table_name[Customer] )
),
, , DENSE
)Please be aware of replacing "table_name" with the actual name of your table.
If this answer helped you, please consider marking it as solution.
Thank you!
Cheers
Tim
Hi @Nun
you can achieve this by adding a calculated column to your table using the following DAX:
rank =
RANKX(
ALL( table_name ),
CALCULATE(
SUM( table_name[Total Sales] ),
ALL( table_name ),
table_name[Customer] = EARLIER( table_name[Customer] )
),
, , DENSE
)Please be aware of replacing "table_name" with the actual name of your table.
If this answer helped you, please consider marking it as solution.
Thank you!
Cheers
Tim
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |