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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mpicca13
Resolver IV
Resolver IV

DAX Dynamic RANKX not changing Axis values

I'm currently working on a Covid-19 Dashboard and I have created a measure which ranks the top 10 counties in the US by new confirmed cases for the day.

 

The measure for new confirmed cases is : 

DoD Confirmed Case Count Change = [Confirmed Cases for Current Day] - [Confirmed Cases Yesterday]
 
My Rank Measure is:
Top Counties =
VAR RankByCounty = RANKX( ALLSELECTED( Region[County & State]), [DoD Confirmed Case Count Change], , DESC)

RETURN
CALCULATE(
    [DoD Confirmed Case Count Change],
        FILTER( Region, RankByCounty <= 10 )
)  
 
Now when I select a date from the past, all of my [DoD Confirmed Case Count Change] values will change accordingly by the but the Axis values Region[County & State] will remain in place in the visual, this leads to the same county and region axis values but whichever county is not placed in top 10 for the selected prior date that is currently palced top 10 for the current date  will show a DoD case count value of 0.
 
See below images for reference:
 
Visual with date filter set to today:
Capture.PNG
 
Visual with date filter set to 4/03/2020:
Capture1.PNG 
 
I need te Axis values to change accordingly showing the corresponding DoD Case Count values
I feel that this issue lies in my Rank formula.
 
1 ACCEPTED SOLUTION
mpicca13
Resolver IV
Resolver IV

I have resolved the problem.

The issue was not in the DAX formula, it was in the visual interaction.

The interaction was set to "Highlight" .

I have changed it to "Filter" and now it works as intended.

View solution in original post

1 REPLY 1
mpicca13
Resolver IV
Resolver IV

I have resolved the problem.

The issue was not in the DAX formula, it was in the visual interaction.

The interaction was set to "Highlight" .

I have changed it to "Filter" and now it works as intended.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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