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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Arkhos94
Helper IV
Helper IV

Rankx : work if "expression" is a measure but not with direct calculation ?

I have a basic table "aftersales" like this :

DealerSales
A1000
B3000
C2000
D1700
E5000

 

I want to tank them.

 

If I do it creating two measure it works :

measure 1 : sales_amount = sum('aftersales'[Sales])

measure 2 : ranking = rankx(all('aftersales'[Dealer],[sales_amount])

 

But If I try to put it all in 1 measure, it fails (everyone get ranked 1)

measure 3 : ranking = rankx(all('aftersales'[Dealer],sum('aftersales'[Sales]))

 

Can someone help me understand why ?

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

 

 

measure 3 :

ranking =
RANKX (
ALL ( 'aftersales'[Dealer] ),
CALCULATE ( SUM ( 'aftersales'[Sales] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Arkhos94
Helper IV
Helper IV

thanks @SanketBhagwat and @Jihwan_Kim  for your help

 

It did not work by removing the sum but it worked by adding a calculate before the sum

SanketBhagwat
Solution Sage
Solution Sage

Hi @Arkhos94 .

You don't need to use 'sum' in here;

ranking = rankx(all('aftersales'[Dealer],sum('aftersales'[Sales])).

 

Remove 'sum' function and try it.

 

If this helps you, then please mark it as 'Accept as Solution' so that others could find it easily and give it a big thumbs up.

 

Regards,

Sanket Bhagwat

Jihwan_Kim
Super User
Super User

 

 

measure 3 :

ranking =
RANKX (
ALL ( 'aftersales'[Dealer] ),
CALCULATE ( SUM ( 'aftersales'[Sales] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors