cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nj-matt
Frequent Visitor

Dax to sum multiple rows within same table

I have a table with many rows of detail that I need to maintain, but I also need sum for multiple rows to generate ROI.

 

Promotion #Gross SalesGross Sales (Promo)
123$100$300
123$200$300
124$50$50

 

I need dax to sum up the total of both lines of gross sales on promo 123 to the aggregate Gross Sales (Promo) line.

 

Help?

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @nj-matt 

If you just want to sum values by group, please use formula as below:

measure/calculated column:

Gross Sales (Promo) = CALCULATE(SUM('Table'[Gross Sales]),ALLEXCEPT('Table','Table'[Promotion #]))

veasonfmsft_2-1652752024017.png

 

Best Regards,
Community Support Team _ Eason
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

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @nj-matt 

If you just want to sum values by group, please use formula as below:

measure/calculated column:

Gross Sales (Promo) = CALCULATE(SUM('Table'[Gross Sales]),ALLEXCEPT('Table','Table'[Promotion #]))

veasonfmsft_2-1652752024017.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jaipal
Resolver III
Resolver III

@nj-matt try this 

Measure = SUMX(VALUES('Table'[Promotion]), CALCULATE(SUM('Table'[Gross sales (Promo)])))

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors