Forum Discussion

PowerBITestingG's avatar
PowerBITestingG
Resolver I
2 years ago
Solved

Exclude field from Rankx

I have the following formula:

 

RANKX(ALLSELECTED(ProductList[ProductCode),[Total Quantity],,DESC,Dense)
 
The measure works well, but the issue is that when I put it in a matrix with Month Columns, its ranking based on the Total Quantity for each Month. I want it to rank by the Total Quantity of all months while still keeping the rest of the filters.
 
Any ideas?
 
Edit: Basically the ranking should use the Quantity in the Total column for each month.

ProductCodeJanuaryFebruary Total
ABD12101020
  • Hi PowerBITestingG ,

     

    You need to apply a filter modifier to the measure  your rank is based on. That would be something like

    CALCULATE ( [Total Measure], ALL ( Dates[month column] ) )

     

3 Replies

  • Hi PowerBITestingG ,

     

    You need to apply a filter modifier to the measure  your rank is based on. That would be something like

    CALCULATE ( [Total Measure], ALL ( Dates[month column] ) )

     

      • danextian's avatar
        danextian
        Super User

        If you want just all the visible months in the current context, ALLSELECTED would work. For all months, use ALL instead.