cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RoxFreyja191
Regular Visitor

RANX duplicate rank values

Hi All,

 

I am new to Power Bi (month 1).

 

I am trying to rank client spend. The table with the value of each purchased line does not contain the client name, but it is connected with a relationship on the Order ID. 

 

Here is what I have done:

 

Ranking = RANKX(
CROSSJOIN(
ALL(Organizations[Organisation Name Short]),ALL(SalesOrderLines[omlExtendedDiscountBase])
),
[Total Sales Orders]
)

 

The results almost work, except that there are a few duplicate ranks even though the sales value is not the same.

 

RoxFreyja191_0-1634980093485.png

 

Note rank 3 is used twice.

 

I would appreciate any advice

 

 

 

 

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I think you can try to create a new measure using the Rand() function to assist your original sorting in the measure, you can try my steps:

Create a new measure:

Randome = RAND()

Then change the measure Ranking like this:

Ranking =

RANKX(
CROSSJOIN(
ALL(Organizations[Organisation Name Short]),ALL(SalesOrderLines[omlExtendedDiscountBase])
),
[Total Sales Orders] + [Randome]
)

And you can get what you want, like this:

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I think you can try to create a new measure using the Rand() function to assist your original sorting in the measure, you can try my steps:

Create a new measure:

Randome = RAND()

Then change the measure Ranking like this:

Ranking =

RANKX(
CROSSJOIN(
ALL(Organizations[Organisation Name Short]),ALL(SalesOrderLines[omlExtendedDiscountBase])
),
[Total Sales Orders] + [Randome]
)

And you can get what you want, like this:

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

RoxFreyja191
Regular Visitor

Sorry need to clarify. 

 

The calculation of values takes place in Table A (No Org names) it connects with a sales order ID to Table B which has a short version of the customer ID which connect to table C (Organisations) that has the category name I want to use.

 

So the relationship is not directly between table A (sales lines) and C (Organisations), its connected through a table B.

 

 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors