Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I have a requirement to show top 20 values in a table.
For that I have used RANKX function. Code below.
This gives me the correct ranking based on the field volume.
But, after I apply Top 20 filter, the ranking is incorrect. The Ranks are repeated and the values are not in the expected order.
This is happening due to the RL12 filter.
I am only including data where RL12="Y". So, whereever there are no records for RL12=Y, the rank is getting skipped.
Could someone please suggest on how this can be fixed and show all the ranks in order without any repetition.
Thank you
Poojitha
Hi @poojithas ,
You can change All() to the AllSelected() function.
ALLSELECTED function (DAX) - DAX | Microsoft Learn
The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters.
If the display is still incorrect, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yangliu-msft : I have used ALLSELECTED and the output is still incorrect.
There was a visual filter for the field "Type" where the logic was concatenate(comments,ntn/non-ntn) and this had the output as below: I was restricting this to only show Regular NTN and Premium NTN.
Regular NTN |
Regular Non-NTN |
PremiumI NTN |
Premium Non-NTN |
Non-Premium NTN |
Non-Premium Non-NTN |
I created another column with the logic as if type=Regular NTN and Premium NTN then include else exclude. I used this field instead of TYPE in the visual filter. This fixed the issue with Ranking.