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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nj-matt
Helper I
Helper I

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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