Forum Discussion
Anonymous
4 years agoNot applicable
DAX
Hi, I need to calculate sum of $ amounts in column X based on condition GroupBy in column Y, Z. Ex: X Y Z $5 A IND $6 A US $7 B US $8 ...
- 4 years ago
Hi Anonymous ,
According to your description, create the following virtual table.
Out_result = SUMMARIZE ( ABC, ABC[GL Description], "A", IF ( NOT ISBLANK ( CALCULATE ( SUM ( ABC[YTD] ), FILTER ( ALL ( ABC ), MAX ( ABC[GL Description] ) = ABC[GL Description] && ABC[Group] = "CA" ) ) ), CALCULATE ( SUM ( ABC[YTD] ), FILTER ( ALL ( ABC ), MAX ( ABC[GL Description] ) = ABC[GL Description] && ABC[Group] = "CA" ) ), 0 ) )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
4 years agoSuper User
Anonymous , Expected output is not clear
example
calculate(sum(Table[X]), filter(Table, Table[Y] = "A" && Table[Z] = "IND" ))
- Anonymous4 years agoNot applicable
Sorry, Let me share the expected output clearly and the current table structure
The table "ABC"
Column A Column B YTD GL Description
Group $40
Conversion CA $30 Cosourcing PD $80 Fees CA $50 Conversion IK $10 Cosourcing MA
$20 Conversion CA
Output should be as below only for Group "CA"
GL Description YTD Conversion $60 Cosourcing $0 Fees $80 - ryan_mayu4 years agoSuper User
Anonymous
I missed this reply.
Measure 2 = CALCULATE(sum(ABC[YTD]),FILTER(ABC,ABC[Group]="CA"))+0