Pivot table with ranking buckets

gazpage

Active Member
Joined
Apr 17, 2015
Messages
393
Hi,

I'm trying to create a pivot table based on Power Pivot where the rows show two things. Ranking Buckets and Amount Buckets, so something like this.

RankingMeasure1Measure 2 etc
1-10
11-25
26-50
etc

<tbody>
</tbody>

AmountMeasure1Measure 2 etc
1-50k
50k-100k
100k-500k
etc

<tbody>
</tbody>

The challenge I am finding is twofold.

1) I would normally add a calculated column to allow me to filter as shown on the right. However, then the rankings are not dynamic for any filters / slicers etc. For example I might have Company X as the number 1 ranked company, but if you slice out US sales then its rank 50; if that company has a 1 in the calculated column it stays as 1.

2) I'm actually ranking buckets already. The number 1 rank is not the highest valued row, but all the rows belonging to the bucket whose rows sum to the highest value.

Any suggestions?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Well that certainly seems to be it for my second case. Will have to see if I can adapt it to also do ranking; that may be beyond my skill level.

Thanks a lot.
 
Upvote 0
The ClusteredSales: example was exactly what I needed for the second table. Many thanks for pointing it out.

Any idea how to convert that to my first requirement which is to filter it be ranking buckets? I guess I need a new disconnected table and to change the calculation of "CustomerSales" from the ADDCOLUMNS, but not sure I know how to make that a rank.
 
Upvote 0
In case anyone has the same issue, this seems to work.

Code:
CALCULATE (
    SUM ( UnitTape[Discounted Bank Value] ),
    FILTER(
            ADDCOLUMNS (
                'Properties',
                "RankValue",
                RANKX ( 
                    ALLSELECTED ( 'Properties' ),
                    CALCULATE ( SUM ( UnitTape[Discounted Bank Value] ) )
                )
            ),
            COUNTROWS (
                FILTER (
                    RankSegment,
                    [RankValue] >= RankSegment[Min]
                    && [RankValue] <= RankSegment[Max]
                )
        ) > 0
    )
)

My column names are different, but it's the same pattern.
 
Upvote 0

Forum statistics

Threads
1,215,777
Messages
6,126,838
Members
449,343
Latest member
DEWS2031

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top