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
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.