Forum Discussion
Fragan
6 years agoHelper III
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...
- 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) ))
amitchandak
6 years agoSuper User
Create a measure like that and using hasonevalue or isfiltered , use that for GT
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
something like this
GT Measure =sumx(Summarize(Table,Table[Attribute],"_1", sumx(Table,if(Table[Attribute] ="Attribute2" ,Table[Value]/2,Table[Value]))),[_1])
if(isfiltered(Table[Attribute]),sum(Table[Value]),[GT Measure])