Forum Discussion

MMoran's avatar
MMoran
Frequent Visitor
3 years ago

Dynamic row number by date

Hi,

 

I have a dense rank over the date column so that all dates have the same row number regardless of however the data is sliced, in this example it is by gender:

However, if I then filter the data on a metric that doesn't have a value for every date I get this :

My DAX statement for the dense rank is 

Rank =
 RANKX(FILTER('Table','Table'[MetricName]= EARLIER('Table'[MetricName])),'Table'[Date],,ASC,Dense)
 
Is it possible to have the rank act dynamically so that if a filter is selected where dates are missing it does this?
 

 


 

 

 

 

5 Replies

  • Slap another RANKX computation onto your original rank, make it ascending and add 7.

    • MMoran's avatar
      MMoran
      Frequent Visitor

      Thanks for the reply, I don't necessarily need it to start on 8 just as long as the numbers are consecutive but I'm not sure what I should be using for the expression in the RANKX?

      I've tried this but just getting 1's all the way down.

       

      • lbendlin's avatar
        lbendlin
        Super User

        Please provide sanitized sample data that fully covers your issue.
        Please show the expected outcome based on the sample data you provided.