I have a pivot table where I want to rank the overall performance of regions by clearing the area filter.
It looks just like this example :
https://powerpivotpro.com/2015/06/rankx-apalooza-within-and-across-groups-with-filters-etc/
I first wrote a measure similar to this one :
=
IF (
HASONEVALUE ( Stores[Region] ),
RANKX (
ALL ( Stores[Region] ),
CALCULATE ( [Units Sold], ALL ( Stores[Area] ) ),
,
1,
SKIP
),
BLANK ()
)
I understand it and if a region doesn't have any unit sold (blank result), it will be ranked as number 1. I want the first non blank to be ranked as number 1.
I tried this version and now I don't rank blank values but I don't remove the Area filter within the rank. My results are similar to the ''Region Rank Within Area'' measure in the image above.
=
IF (
HASONEVALUE ( Stores[Region] ),
RANKX (
FILTER ( ALL ( Stores[Region] ), NOT ( ISBLANK ( [Units Sold] ) ) ),
CALCULATE ( [Units Sold], ALL ( Stores[Area] ) ),
,
1,
SKIP
),
BLANK ()
)
How can I rank my regions that have at least 1 unit sold and ignore the area filter in my pivot table at the same time?
Thank you!
It looks just like this example :
https://powerpivotpro.com/2015/06/rankx-apalooza-within-and-across-groups-with-filters-etc/
I first wrote a measure similar to this one :
=
IF (
HASONEVALUE ( Stores[Region] ),
RANKX (
ALL ( Stores[Region] ),
CALCULATE ( [Units Sold], ALL ( Stores[Area] ) ),
,
1,
SKIP
),
BLANK ()
)
I understand it and if a region doesn't have any unit sold (blank result), it will be ranked as number 1. I want the first non blank to be ranked as number 1.
I tried this version and now I don't rank blank values but I don't remove the Area filter within the rank. My results are similar to the ''Region Rank Within Area'' measure in the image above.
=
IF (
HASONEVALUE ( Stores[Region] ),
RANKX (
FILTER ( ALL ( Stores[Region] ), NOT ( ISBLANK ( [Units Sold] ) ) ),
CALCULATE ( [Units Sold], ALL ( Stores[Area] ) ),
,
1,
SKIP
),
BLANK ()
)
How can I rank my regions that have at least 1 unit sold and ignore the area filter in my pivot table at the same time?
Thank you!
Last edited: