Forum Discussion
Help with Rank in DAX
- Anonymous1 year ago
Hi javif_84
We are happy to hear that your issue has been resolved. Please mark the helpful reply and accept it as the solution. This will assist other community members with similar problems in resolving them more quickly.Thank you.
Hi javif_84
Thank you for reaching out microsoft fabric community forum.
Below is the DAX to get the rank of the Company by its sales
Sales Rank =
RANKX(
FILTER(
ALL('Sheet1'[Company Sales]), -- Removes filters on 'Company Sales' column
NOT(ISBLANK('Sheet1'[Company Sales])) -- Exclude blanks
),
CALCULATE(
IF(ISBLANK(MAX('Sheet1'[Company Sales])), 0, MAX('Sheet1'[Company Sales])) -- Replace blank with 0 and aggregate the values
),
,
DESC, -- Rank in descending order
Dense -- Dense ranking (no gaps)
)
Please find the attached PBIX file for your reference.
Let me know if you need further assistance!
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi
It does not work... 😞 Let me share a sample with the link if it helps, it is a sample with dummy data but same structure
Ok let me share a sample file https://we.tl/t-Cy0nZfPcqH
What I d like is to rank among all categories selected the Company A (just the company A) in the sample
See my real, so i have this table where I built all my metrics for total market and for my company, I selected the fields ZTS TC-L0 and ZTS TC-L1 and I want to have independently of what category/subcategory (ZTC TC L0 and ZTS TC L1) the rank of the company selected
Hope this helps
And thanks so much for the support
best
Javier
- Anonymous1 year agoNot applicable
Hi javif_84
Based on the provided sample, I have created a calculated column for the rank of Company A on estimated sales. Please review the attached .pbix file for further details.If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
- javif_841 year agoHelper I
mmm still does not work see solution provided in another forum... Thanks for everything 🙂