Forum Discussion
Poisedon
7 years agoFrequent Visitor
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 other columns i have data). See image for understand.
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 )
2 Replies
- Zubair_MuhammadCommunity Champion
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 )- PoisedonFrequent Visitor
It works if i take the column with no aggregation, but in my table I've sum of values, so values are wrong in this case :/