Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
aarushirc14
New Member

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. 

aarushirc14_0-1663722472993.png

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: 

PI ROI Yr 1 = SUMX(VALUES('ROI Table'[Parent Initiative]),CALCULATE(SUM('ROI Table'[ROI])))
 
But this expression does not sum ROI values of distinct Initiatives. When using my DAX  function, in the example I provided, the incorrectly calcualted ROI is 16375+16375+29275+29275= 91300.
 
What would be the correct DAX function? **Please note I'm not allowed to change the structure of my table (like removing duplicate Initiatives).

 

1 ACCEPTED SOLUTION
Anonymous
Not 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:

RicoZhou_1-1663840589709.png

Result is as below.

RicoZhou_0-1663840474893.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Anonymous
Not 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:

RicoZhou_1-1663840589709.png

Result is as below.

RicoZhou_0-1663840474893.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

tamerj1
Super User
Super User

Hi @aarushirc14 
Please try

PI ROI Yr 1 =
SUMX (
    VALUES ( 'ROI Table'[Parent Initiative] ),
    CALCULATE ( MAX ( 'ROI Table'[ROI] ) )
)
tamerj1
Super User
Super User

Hi @aarushirc14 
Please try

PI ROI Yr 1 =
SUMX (
    VALUES ( 'ROI Table'[Parent Initiative] ),
    CALCULATE ( MAX ( 'ROI Table'[ROI] ) )
)
ryan_mayu
Super User
Super User

@aarushirc14 

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]))

1.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.