Forum Discussion
RANK Dax issues!
Hi all,
I have the following dataset at my disposal and I'm looking at ranking the SumColumns shown in the dataset after a specific date of 2024, 9, 8 but as you can see there are duplicate values in the sum columns created (dax shown underneath) - and creating this rank measure would also mean dates before 2024, 8, 9 would need to be excluded. I included my current solution underneath these photos that duplicates the table, however I would want to avoid this and just write a new Dax with a new date in when the time comes to change ranges.
Duplication solution:
Thanks for your help in advance!
Jordan
- Anonymous1 year ago
Since I don't know what your data looks like, please try creating a measure to calculate the rank using the following DAX to see if that helps.
RankAfterDate = VAR SpecificDate = DATE(2024, 8, 9) RETURN RANKX( FILTER( ALL('YourTable'), 'YourTable'[DateColumn] > SpecificDate ), CALCULATE(SUM('YourTable'[SumColumn])), , DESC, DENSE )If it doesn't work, please provide some sample data, and remember to protect your data privacy in the sample data.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- lbendlinSuper User
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.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - AnonymousNot applicable
Since I don't know what your data looks like, please try creating a measure to calculate the rank using the following DAX to see if that helps.
RankAfterDate = VAR SpecificDate = DATE(2024, 8, 9) RETURN RANKX( FILTER( ALL('YourTable'), 'YourTable'[DateColumn] > SpecificDate ), CALCULATE(SUM('YourTable'[SumColumn])), , DESC, DENSE )If it doesn't work, please provide some sample data, and remember to protect your data privacy in the sample data.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- jordanwhite16Regular Visitor
Thank you very much! This worked for me!