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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Multiplying max rank (Highest Number) in one column to a static number

Hello everyone, 

I am new to Power BI from Excel and can't seem to find a solution to the following. 

Here is what I need to do and need your help

1. I have sales data in one column and want to rank them smallest to largest (or otherway round) in a seperate column. 

2. Once ranked I want to Identify the Highest rank and Multiply it with a static number like 0.15 in a seperate column. That is if the highest rank number is 235, I want to =235*0.15.

The goal is to have a dynamic calculation so that when the sales data is changed, the then largest rank is selected and multiplied with the fixed number 0.15.

 

Any help will be highly appreciated.

 

M.

 

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

Hi @Anonymous 

You can try my way to achieve your goal by M query as well.

My Sample:

1.png

Open your Power Query Editor:

Group by all rows by Sales:

2.png

Sort Sales by ascending or descending, here i use descending.

Then add an index column and rename it as Rank.

3.png

Remove Sales column and expand ALL.

4.png

Finally add a Custom column.

5.png

If I add Customer H, Sales = 100 in my data source(Excel), and refresh the report.

6.png

Best Regards,

Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

You can try my way to achieve your goal by M query as well.

My Sample:

1.png

Open your Power Query Editor:

Group by all rows by Sales:

2.png

Sort Sales by ascending or descending, here i use descending.

Then add an index column and rename it as Rank.

3.png

Remove Sales column and expand ALL.

4.png

Finally add a Custom column.

5.png

If I add Customer H, Sales = 100 in my data source(Excel), and refresh the report.

6.png

Best Regards,

Rico Zhou

 

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

 

harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

Create 2 Calculated columns

 

Rank Sales = RANKX('Table1',Table1[Sales],,DESC,Dense)

 

Static Multiply = IF (Table1[Rank Sales] = 1, Table1[Sales]*0.15)

 

1.JPG

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.