Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi there!
I got the following Ranking DAX measure not working:
Ranking de Item = RANKX(ALL(Sales[Item]);[SalesValue])
When using it on a card visual, it gives me either 1 or 2 as the result, while it should be 15, or 20, for example.
Sales Table:
Date | Item | Qty | Sales |
01/01/2019 | Item1 | 10 | 100 |
01/15/2019 | Item 2 | 5 | 50 |
01/30/2019 | Item 1 | 3 | 30 |
02/10/2019 | Item 3 | 1 | 10 |
The above table is filtered by a slice, where I have Item from ItemTable, which, in turn, filters Sales Table.
Your help is greatly appreciated.
Cheers,
Antonio Santos
Hi @Asantos2020 ,
Your DAX works fine in my sample data and the result was correct as below:
Here’s my sample data and measures;
Measure = SUM(Sales[Sales])
Ranking de Item = RANKX(ALL(Sales[Item]),[Measure])
I think there might be something wrong about the [Sales Value] in your DAX.
Could you please share your Pbix and expected result to me if you don't have any Confidential Information?
If so, please upload your files to One Drive and share the link here.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-jayw-msft ,
Thanks a lot for the detailed response.
I've managed to find where the flaw was. I was ranking it on Sales Tabl[Item], which is filtered by Items Table. I've changed it to:
Ranking = Rankx(All(ItemTable[Item];[sales])
...which works fine on a table visual. However, if I want the item's ranking on a visual card, one of the item shows its rank as 2, while it is 1 on the table. That's where the pain is now.
I understand that having the file would be best to find problem, but it contains condidential info, unfortunately.
Thank you!!!
Cheers,
Antonio
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |