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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Arlenio
Regular Visitor

Problems with RANKX and FILTER

Hi guys, could you help me?

I want to rank some data, but I'm having problems.
I want him to NOT consider rank values ​​greater than 100 and less than 0. However, he is classifying values ​​greater than 100 as First. How to fix this and put them in last?

 
 
 

Capture.JPG

6 REPLIES 6
amitchandak
Super User
Super User

Hi guys, here its how a solved the problem

Arlenio_0-1593136152677.png

Arlenio_1-1593136163164.png

 

 

harshnathani
Community Champion
Community Champion

HI @Arlenio ,

 

Not sure what id the end objective and very difficult to help you without the sample pbix.

 

Try this.

 

RANK =
VAR _roe = [ROE]
RETURN
    RANKX (
        FILTER (
            ALLSELECTED ( 'dAcoesSiglas' ),
            _roe < 100
                && _roe >= 0
        ),
        _roe,
        DESC,
        DENSE
    )

 

Regards,

HN

 

I tried here, but with no success. I can send you the file by whatsapp or something like that.. could you help me?

 

or by email if you want.

 

This is the result with your dax formula

Arlenio_0-1593104430525.png

Arlenio_1-1593104448005.png

 

harshnathani
Community Champion
Community Champion

Hi @Arlenio ,

 

Try like this.

 

 

RANK =
RANKX (
    ALLSELECTED ( 'dAcoesSiglas'[Papel] ),
    [ROE],
    ,
    DESC,
    DENSE
)

 

 

Then in Filter this Visulaization 

 

 

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

I cannot put it in the visualization filter because for other measurements I will need all the data. would you have any more suggestions?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.