Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 ()
)
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