|
发表于 2014-10-31 09:04:10
|
显示全部楼层
flat26a 发表于 2014-9-19 14:45
谢谢楼主!我发给你Gmail邮箱了,请查收
I have sent the completed file back to your email. You can also download the sample workbook from below link.
https://onedrive.live.com/?cid=7 ... 5E31C189063EC%21124
I know you probably do not know Power Pivot much. The key to address your issue is having a disconnected table ( do not set up relationship with your main table), in your case it's the TOP X table with one column. You can google Disconnected Table and find lots of interesting post on this top for Power Pivot.
I start off by building the base measure Spend = SUM(DATA[AMOUNT])
Number of Supplier = DISTINCTCOUNT(DATA[VENDOR_NAME])
then I rank your category based on Spend CategoryRank = RANKX(ALL(DATA[Category]),DATA[Spend])
Finally the driver for Dynamic TOP N count is hidden measure(hide it as your users don't need to see it)
IF(HASONEVALUE('TOP'[TOP X]),IF(DATA[CategoryRank]
2014-9-19 23:43:11 上传
下载附件 (78.27 KB)
2014-9-19 23:43:12 上传
下载附件 (25.52 KB)
All the formula are exclusive to Power Pivot which is DAX formula and they are not part of normal Excel functions.
There you have it. Dynamic TOP N (what ever you like to call it) |
|