Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Total using SUMX() and calculated table is not correct

I have a measure that used SUMX and calculated table. 
How can I get a total of column "Open" that is created within calculated table.
On a picture you see 12, which is incorrect. The correct number is 335.


TestMeasure =
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER (
                SumByClaim,
                SumByClaim[TransactionDate] >= FIRSTDATE ( SumByClaim[TransactionDate] )
                    && SumByClaim[TransactionDate] <= LASTDATE ( SumByClaim[TransactionDate] )
            ),
            SumByClaim[ClaimNumber],
            SumByClaim[ClaimantID],
            SumByClaim[ClaimStatus],
            "MaxTransDate", MAX ( SumByClaim[TransactionDate] )
        ),
        "Open", IF (
            SumByClaim[ClaimStatus] = "Open"
                && [MaxTransDate] = MAX ( SumByClaim[TransactionDate] ),
            1,
            0
        )
    ),
    [Open]
)



 

4 Replies