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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.