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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
trishd1223
Frequent Visitor

Rankx skipping 0's/blanks

Hi - I'm having trouble with Rankx.  I don't want to rank 0's or blanks.  I was able to get the rankx to avoid assigning a rank # to 0's, however, it doesn't skip and resume to the next rank #.  For example, the -$73k I want to be a rank of 4 instead of 2809. 
Rankx.png
Here is the formula I used to get these results. 
 
Rank adam test $ chg 2 = IF([$ Chg Column for Ranking - adam]<>0, IF(ISINSCOPE((AppendedData[Brand])), RANKX(ALLSELECTED(AppendedData[Brand]),[$ Chg Column for Ranking - adam])))
 
Thanks! 
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@trishd1223 

Can you try the following measure?

Rank adam test $ chg 2 =
IF (
    [$ Chg Column for Ranking - adam] <> 0
        && ISINSCOPE ( AppendedData[Brand] ),
    RANKX (
        FILTER (
            ALLSELECTED ( AppendedData[Brand] ),
            [$ Chg Column for Ranking - adam] <> 0
        ),
        [$ Chg Column for Ranking - adam]
    )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@trishd1223 

Can you try the following measure?

Rank adam test $ chg 2 =
IF (
    [$ Chg Column for Ranking - adam] <> 0
        && ISINSCOPE ( AppendedData[Brand] ),
    RANKX (
        FILTER (
            ALLSELECTED ( AppendedData[Brand] ),
            [$ Chg Column for Ranking - adam] <> 0
        ),
        [$ Chg Column for Ranking - adam]
    )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

andhiii079845
Solution Sage
Solution Sage

Try this: 
Rank adam test $ chg 2 =
IF([$ Chg Column for Ranking - adam]<>0, IF(ISINSCOPE((AppendedData[Brand])), RANKX(FILTER(ALLSELECTED(AppendedData[Brand]) && [$ Chg Column for Ranking - adam] <>0 && [$ Chg Column for Ranking - adam] <>BLANK() ,[$ Chg Column for Ranking - adam])))





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.