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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi
Im fairly new to dax - and use chat gpt for a lot of my stuff.
So i'm sorry if I don't have a deeper understanding.
Gross Profit =
CALCULATE(
[Sum of Sales] - ([Linehaul Amount Cost] + [Lastmile Amount Cost])
)
I have this measure - what I want to use to rank my customers.
Customer GP Rank - TOP 10 =
RANKX(
ALL('MDS CG1'[CustomerGroupName]),
CALCULATE([Gross Profit]),
,
DESC,
DENSE
)
And this works alright :
But if I add another dimension, then it stops working.
Not only does it apply 1 to all customers - and not keeping the rank across all Markets:
Solved! Go to Solution.
Hi @DennisSchlein ,
Thank you for reaching out to the Microsoft Community Forum.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @DennisSchlein ,
Thank you for reaching out to the Microsoft Community Forum.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @DennisSchlein ,
Thank you for reaching out to the Microsoft Community Forum.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @DennisSchlein ,
Thank you for reaching out to the Microsoft Community Forum.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi,
Share some data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Try the RANK function. It's generally preferred over RANKX. You'll need to specify each column in the visual; this example assumes that the second column in the visual is CustomerName.
Customer GP Rank - TOP 10 =
RANK (
DENSE,
ALLSELECTED ( 'MDS CG1'[CustomerGroupName], 'MDS CG1'[CustomerName] ),
ORDERBY ( [Gross Profit] ),
DESC
)
https://www.sqlbi.com/articles/introducing-the-rank-window-function-in-dax/
Proud to be a Super User!