Forum Discussion
Is RANKX the right answer to this problem?
Hi Anonymous ,
first of all, thank you so much for your help.
I can see that your solution is working in your example file, so I've tried to apply it to my user scenario but it's not working 100%.
Let me try to explain my case.
I have 1 single table with with metric_1, and metric_2 by country and date.
On this table I have 2 date slider, that work on the same date dimension.
Date range 1 slicer has an active relationship with the table while slicer 2 has an inactive relationship.
If you look at the Rank 1 measurement your code is working perfectly, it is considering only the dates with metric_1 > 0 and the rank is correct.
On Rank_2 things get interesting...
The formula of rank 2 is the same as rank 1, it just considers the metric_2.
The ranking is correct only for the overlapping days but not for the remaining date_range_2 days that are not included in the date range 1 slicer.
It looks like that the ranking does not work properly for the date that are not included in the date range 1 slicer.
Here is an example of full overlap on date range slicer:
And another example with no days overlapping
- Anonymous3 years agoNot applicable
Hi 3maris ,
In order to get a better understanding on your requirement and give you a suitable solution, could you please provide some raw data in your table (exclude sensitive data) with Text format, visual settings(slicers&matrix) and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
- 3maris3 years agoFrequent Visitor
Hi Anonymous ,
here is the pbix file https://www.dropbox.com/s/7s6v43dqlr358iy/Ranking_PBI.pbix?dl=0
I've also added an example of why I'm trying to get the rank.
I'm still not 100% sure this is the best option to get to it.
Thanks again for your time!