Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Asantos2020
Advocate II
Advocate II

Ranking DAX not working for me

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:

DateItemQtySales
01/01/2019Item110100
01/15/2019Item 2550
01/30/2019Item 1330
02/10/2019Item 3110

 

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

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Asantos2020 ,

 

Your DAX works fine in my sample data and the result was correct as below:

1.PNG

2.PNG

Here’s my sample data and measures;

Measure = SUM(Sales[Sales])

Ranking de Item = RANKX(ALL(Sales[Item]),[Measure])

3.PNG

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

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 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.