问题
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