Forum Discussion
PowerBITestingG
2 years agoResolver I
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.
| ProductCode | January | February | Total |
| ABD12 | 10 | 10 | 20 |
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
- danextianSuper User
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] ) )- PowerBITestingGResolver I
Instead fo ALL I used ALLSELECTED and that seems to work. Thanks!
- danextianSuper User
If you want just all the visible months in the current context, ALLSELECTED would work. For all months, use ALL instead.