Forum Discussion
Group and sum distinct values
I need to group Initiatives together and calculate the ROI sum for each Parent Intiative. When calculating the ROI sum for a Parent Intiative, each unique Intiative (or unique ID) should only be included in the sum once.
For example,
Parent Initiative: IG BI Data Pulls. So the Initiatives are IG BI Data Pulls Phase 1 and IG BI Data Pulls Phase 2. So the ROI sum is 16375+29275= 45650.
Currently I'm using the following DAX:
- Anonymous3 years ago
Hi aarushirc14 ,
Here I suggest you to create a measure by below code.
PI ROI Yr 1 = SUMX(SUMMARIZE('ROI Table','ROI Table'[Parent Intiative],'ROI Table'[ROI]),[ROI])Sample:
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- ryan_mayu
Super User
i think you can create a new ROI column and use the new column to do the calculation
Column = 'Table'[ROI]/CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[ID])) - tamerj1
Community Champion
Hi aarushirc14
Please tryPI ROI Yr 1 = SUMX ( VALUES ( 'ROI Table'[Parent Initiative] ), CALCULATE ( MAX ( 'ROI Table'[ROI] ) ) ) - tamerj1
Community Champion
Hi aarushirc14
Please tryPI ROI Yr 1 = SUMX ( VALUES ( 'ROI Table'[Parent Initiative] ), CALCULATE ( MAX ( 'ROI Table'[ROI] ) ) ) - AnonymousNot applicable
Hi aarushirc14 ,
Here I suggest you to create a measure by below code.
PI ROI Yr 1 = SUMX(SUMMARIZE('ROI Table','ROI Table'[Parent Intiative],'ROI Table'[ROI]),[ROI])Sample:
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.