PowerPivot DAX - Dynamic Ranking Per Group (Min Per Group)

戏子无情 提交于 2019-11-29 14:06:55

Although this is a well written question that you've obviously put time into formulating, you should read this about cross posting in forums. This is a clear duplication of something you've posted on MSDN at exactly the same time. I've answered in both seeing as its a decent question.

Firstly I created a basic measure [Amount] to sum the dollar amount column. I then used that within RANKX() to create the following:

[Rank] = RANKX(
         FILTER(
         ALLSELECTED(Table1),Table1[Claimant Number]=max(Table1[Claimant Number])
                   ),
         [Amount],
            ,1)

The key is the table that the [Amount] measure is iterated over - ALLSELECTED() just brings the stuff in the current filter context into play and the expression within the FILTER() restricts the table to the current claim number.

After that it was a simple task to return the [Amount] based on whether or not the [Rank] was 1:

[Opening Balance] = if([Rank]=1,[Amount],BLANK())

Hope this makes sense, I posted my workings on SkyDrive if they help.

Jacob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!