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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Dog
Responsive Resident
Responsive Resident

RANKX not return true rank value when performed on a calculated column

Hi All, 

 

I am currently using RANKX to perform ranks dynamically depending on whether or not the end user has drill down through on a bar chart visual

 

I am using the following switch statement (section posted below) to check filtered context from a slicer and drill through filtering.

This statement works as I want but the issue relates to the returned values from the RANKX function, two the of three fields that are being used for ranking are calculated columns and are return 1’s for each rank, whereas the “CoreNominal Title” field is a fixed data field and returns the correct ranking values.

 

Thanks


Dog

 

SWITCH (

            ContFilter,

            "Actual year to date vs Budget year to date",

                IF (

                [IncomeNActualYTDvsBudgetYTD] < 0,

                IF (

                    ISFILTERED ( Nominals[SplitReportGrouping] ),

                    RANKX (

                        FILTER ( ALL ( Nominals[SplitReportGrouping] ), [IncomeNActualYTDvsBudgetYTD] ),

                        [IncomeNActualYTDvsBudgetYTD],

                        ,

                        ASC,

                        DENSE

                    ),

                    IF (

                        ISFILTERED ( Nominals[Management Title] ),

                        RANKX (

                            FILTER ( ALL ( Nominals[Management Title] ), [IncomeNActualYTDvsBudgetYTD] ),

                            [IncomeNActualYTDvsBudgetYTD],

                            ,

                            ASC,

                            DENSE

                        ),

                        IF (

                            ISFILTERED ( Nominals[CoreNominal Title] ),

                            RANKX (

                                FILTER ( ALL ( Nominals[CoreNominal Title] ), [IncomeNActualYTDvsBudgetYTD] ),

                                [IncomeNActualYTDvsBudgetYTD],

                                ,

                                ASC,

                                DENSE

                            ),

                            BLANK ()

                        )

                    )

                ),

                BLANK ()

            )

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Dog,

 

Not clear about your table structure, so I was unable to replicate your scenario. I used below measure formula which returns correct rank values dynamically basaed on slicer.

 

Rank measure= 
RANKX (
    ALLSELECTED ( Nominals),
    LASTNONBLANK ( Nominals[IncomeNActualYTDvsBudgetYTD], 1 ),
    ,
    ASC,
    DENSE
)

 

For more advice, please share some sample data and report design and all necessary formulas of measure/calculated column so that I can test for you.

 

Regards,
Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors