March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to rank companies based on their revenues in my data set. It is a large data set with many rows of data for each company in a year and am looking for their rank based on revenue largest to smallest within the year I am filtered to across my Power BI file.
Formulas I am using:
1 Rank = RANKX(ALL('table'[company_name]),[Revenue])
1 Walmart Rank = If ([Walmart Revenue] = 0,0,Calculate ([1 Rank],'table'[company_name]="Walmart"))
The goal is to have it return Walmarts rank across different product categories I have in the first column of my table. (Ex: Electronics in row 1, Apparel in row 2 - I want to see how walmart ranks by revenue compared to other companies for each category).
The issue I am running into with my formulas is that Walmart is number one when I look at the raw data, but is showing up as number 2 when i use the '1 Walmart Rank' formula in my table.
Will appreciate any assistance that can be provided!
Thank You
Hi @Anonymous
It would be more helpful for us to understand your purpose if you could share some dummy data and expected result. When a Rank formula is in a measure in the report or in a calculated column, it may return different results because the context for calculation is different. Also, when you only use ALL in the formula, the category will not be taken into account.
Best Regards,
Community Support Team _ Jing
@Anonymous Hard to know for sure without sample data. To *Bleep* with RANKX! - Microsoft Power BI Community
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |