Forum Discussion

philtab's avatar
philtab
Frequent Visitor
9 years ago
Solved

Sum negative values for groups

Hi all,   I have somehow a tricky problem. I want to create a measure which sums the negative values per Company and Account:   Company Account Value A K100 10 A K100 -10 A K2...
  • Vvelarde's avatar
    9 years ago

    philtab

     

     

    Hi, please try with this measure:

     

    SumNegatives =
    SUMX (
        SUMMARIZE (
            Table1,
            Table1[Company],
            Table1[Account],
            "SumValues", CALCULATE ( SUM ( Table1[Value] ) )
        ),
        IF ( [SumValues] < 0, [SumValues], 0 )
    )

    Regards

     

    Victor

    Lima - Peru