Forum Discussion

Poisedon's avatar
Poisedon
Frequent Visitor
7 years ago
Solved

Sum by category

Hi all, In the Query I need to sum values by "Client" but I can't use "Group by..." because it deletes other columns. I also want to put 0 for other rows with same Client (can't delete because in ot...
  • Zubair_Muhammad's avatar
    7 years ago

    Poisedon

     

    Try a new calculated column like

     

    Column =
    IF (
        [Value]
            = CALCULATE ( MAX ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[Client] ) ),
        CALCULATE ( SUM ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[Client] ) ),
        0
    )