Serdia
Serdia

Reputation: 4428

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

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]
        )

enter image description here

Result should look like this:

enter image description here

Upvotes: 0

Views: 1893

Answers (1)

CR7SMS
CR7SMS

Reputation: 2584

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.

Upvotes: 2

Related Questions