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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi all,
I need your help on this please:
I have a Power BI model that contains the following two tables:
Sales(Sales_ID, sales_date, sales_amount, CustomerID)
Customer(CustomerID, First_name, Last_name)
There is a relationship between Sales and Customer.
I need to create a measure to rank the customers based on their total sales amount.
Which DAX formula should I use?
Is this the right formula: RANKX(ALL(customer), SUMX(RELATEDTABLE(Sales), [Sales_amount])) ?
Many thanks.
Solved! Go to Solution.
Hi @Anonymous
You may try below measure:
Measure =
RANKX ( ALL ( Customer ), CALCULATE ( SUM ( Sales[sales_amount] ) ) )
Regards,
@Anonymous wrote:Hi all,
I need your help on this please:
I have a Power BI model that contains the following two tables:
Sales(Sales_ID, sales_date, sales_amount, CustomerID)
Customer(CustomerID, First_name, Last_name)
There is a relationship between Sales and Customer.
I need to create a measure to rank the customers based on their total sales amount.Which DAX formula should I use?
Is this the right formula: RANKX(ALL(customer), SUMX(RELATEDTABLE(Sales), [Sales_amount])) ?
Many thanks.
I think correct ans is RANKX(ALL(Sales), SUMX(RELATEDTABLE(Customer), [Sales_amount])).
Bez question is asking to create a measure in Sales Table. Correct me If I am wrong?
Hi @Anonymous
You may try below measure:
Measure =
RANKX ( ALL ( Customer ), CALCULATE ( SUM ( Sales[sales_amount] ) ) )
Regards,
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 26 |