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
rpinxt
Impactful Individual
Impactful Individual

RANKX ranking also totals?

Why would rankx also rank my table total??

rpinxt_0-1666268261120.png

 

I know I can take out the totals and then the ranking would be fine but there must be a way to also show your totals without them being ranked??

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @rpinxt ,

 

You can add a condition to your measure so the total doesn't show a rank.

rankx without total =
IF ( HASONEVALUE ( 'Backorder Details'[Origin] ), [rankx measure] )

The total has multiple values of [Origin] so it will not show a rank. Alternatively, you can use SELECTEDVALUE

rankx without total =
IF (
    SELECTEDVALUE ( 'Backorder Details'[Origin] ) <> BLANK (),
    [rankx measure]
)

By default/when the second argument is omitted, SELECTEDVALUE returns blank if the current row returns multiple values which is the case for the total. The second formula is to return a rank only if SELECTEDVALUE ( 'Backorder Details'[Origin] ) is not blank.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @rpinxt ,

 

You can add a condition to your measure so the total doesn't show a rank.

rankx without total =
IF ( HASONEVALUE ( 'Backorder Details'[Origin] ), [rankx measure] )

The total has multiple values of [Origin] so it will not show a rank. Alternatively, you can use SELECTEDVALUE

rankx without total =
IF (
    SELECTEDVALUE ( 'Backorder Details'[Origin] ) <> BLANK (),
    [rankx measure]
)

By default/when the second argument is omitted, SELECTEDVALUE returns blank if the current row returns multiple values which is the case for the total. The second formula is to return a rank only if SELECTEDVALUE ( 'Backorder Details'[Origin] ) is not blank.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
rpinxt
Impactful Individual
Impactful Individual

Thank you! @danextian 

 

That did the trick. Bit strange they did it not make a default (not ranking totals), but your solution fixed it 😁

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.