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
Anonymous
Not applicable

RANKX trun 1 after insert extra column

Hi

I am new in PowerBi  and I learn  a lot in the Community Blog

the Rankx work fine if I just put the ItemID , Sum of Qty and Rank using Table visual

table.JPG

Sum of QTY = SUM('PWBI'[QTY]) and rank = RANKX(ALL(PWBI[ItemNumNoZ]),[Sum of QTY],,DESC,Dense)

If I insert a  extra coloumn , it will show all the item and rank will change 1.

Capture with  extra coloumn.JPG

What I need to change  the measure?

thank-you

1 ACCEPTED SOLUTION

Hi, @Anonymous

 

You should replace 'Rankx' with your own table name. So, in your scenario, the formula:

 

rank = RANKX(ALLEXCEPT('PWBI','PWBI'[ItemNumNoZ]),[Sum of QTY],,DESC,Dense)

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi, @Anonymous

 

If your expected result is as shown from the below image, you need to modify the rank formula as:

rank = RANKX(ALLEXCEPT('Rankx','Rankx'[ItemNumNoZ]),[Sum of QTY],,DESC,Dense)

3.PNG

 

If your expected result is like below image, the formula should be changed as:

rank3 = RANKX(ALL('Rankx'[ItemNumNoZ]),CALCULATE(SUM('Rankx'[QTY]),ALLEXCEPT('Rankx','Rankx'[ItemNumNoZ])),,DESC,Dense)

4.PNG

 

If you have any question, please feel free to ask.

 

Best regards,
Yuliana Gu

 

 

 

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Gu

I have a erro when I  replace yours

error .JPG

 Rank and Sum of QTY is Measure . Do I need to change to Coloumn instead of Measure ?

Please have a advices

 

thank-you 

Hi, @Anonymous

 

You should replace 'Rankx' with your own table name. So, in your scenario, the formula:

 

rank = RANKX(ALLEXCEPT('PWBI','PWBI'[ItemNumNoZ]),[Sum of QTY],,DESC,Dense)

Thanks,
Yuliana Gu

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

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.