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

后端 未结 1 1506
挽巷
挽巷 2020-12-20 20:10

I am searching for a method to utilize within Microsoft PowerPivot 2010 that will allow me to perform dynamic ranking that will automatically update the ass

相关标签:
1条回答
  • 2020-12-20 21:12

    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

    0 讨论(0)
提交回复
热议问题