Forum Discussion

Fragan's avatar
Fragan
Helper III
6 years ago
Solved

Custom total calculation for one column value

Hey,   I have this table :     I made a matrix visual out of it :   What i want to do is change the totals to : For  Attribute1 keep the totals For Attribute2, totals = totals...
  • Fragan's avatar
    6 years ago

    I found a solution :

     

     

    Mesure = SUMX( 'Data'; SWITCH('Data'[attributes];
    "Attribut2";IF(HASONEVALUE('Data'[date]);CALCULATE(SUM(Data[value]);Data[attributes] = "Attribut2");CALCULATE(SUM(Data[value]);Data[attributes] = "Attribut2")/2);
    var a = 'Data'[attributes] return
            CALCULATE ( SUM ( 'Data'[value] );'Data'[attributes]=a)
    ))