简体   繁体   中英

Excel PowerPivot: Dynamic Rank

I'm trying to create a measure that re-calculates the rank in the power pivot table everytime the user deselects a value or changes the group by row labels. For example, per table below, there are 3 companies rates per quote id with their respective rank in each quote.

在此处输入图像描述

Is there a measure that can recalulcate the rank of each company's rate per quote id if the user deselects company B so that power pivot table would look like this:

在此处输入图像描述

Also, can the same measure also recalculate the rank by averaging the rank of each quote id if the user removed quote id from the row labels for the power pivot table so that power pivot table would look like this:

在此处输入图像描述

Any help appreciated.

Ranking = IF ( ISFILTERED ( Quotes[Quote] ), RANKX ( FILTER ( ALLSELECTED ( Quotes[Company] ), [Rate Total] ), [Rate Total],, ASC ), AVERAGEX ( VALUES ( Quotes[Quote] ), RANKX ( FILTER ( ALLSELECTED ( Quotes[Company] ), [Rate Total] ), [Rate Total],, ASC ) ) )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM