How to create dynamic ranking that would respond by date slicer in Power bi

北城余情 提交于 2020-01-16 08:05:12

问题


I simply need to create ranking column for each ClaimantID based on TransactionDate DESC.

example .pbix file can be found here: https://www.dropbox.com/s/9dsnylng70t5a8i/Count%20Open%20and%20Closed%20at%20Point%20of%20time.pbix?dl=0

On a picture below I have two unique claims with TransactionDate.

So how can I RANK ClaimantID by TransactionDate in descending order?

I tried to create column Rank. But it does not give me desirable result:

Rank = 

    RANKX(
        CALCULATETABLE(
            Claimants
            ,ALLEXCEPT(Claimants,Claimants[ClaimantID])
                      ),Claimants[TransactionDate]
        )

Result should look like this:


回答1:


Change you Rank Calculation:

Rank = 

    RANKX(
        CALCULATETABLE(
            Claimants
            ,ALLEXCEPT(Claimants,Claimants[ClaimNumber],Claimants[ClaimantID])
                      ),Claimants[TransactionDate],,DESC,Dense
        )

Also currently in the table there are multiple transactions for the same date and you are summing up the rank. Change it to minimum of rank to get the correct results.



来源:https://stackoverflow.com/questions/59687376/how-to-create-dynamic-ranking-that-would-respond-by-date-slicer-in-power-bi

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