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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
pedrams
Regular Visitor

Sum all Values in one column depending on Values of other column

Hi all,

 

I would like to sum the values in the column "amount" for all unique values in column "merchant-order-id" and only keep the uniqe value of "merchant-order-id" with the summed "amount".

 

I hope my question is clear. Thank you!

 

power_bi

1 ACCEPTED SOLUTION

Yes. Just add all the columns you want to keep here:

 

NewTable = SUMMARIZE(YourTable, YourTable[merchant-order-id], COLUMN1, COLUMN2, "Amount", sum(YourTable[Amount]))

 

PS.: if you think my answer solves your problem, don't forget to mark the post as solution. 🙂

Regards. 

View solution in original post

3 REPLIES 3
MarcoRotta
Resolver I
Resolver I

Hi pedrams.

 

SUMMARIZE function can do that to you. Docs and samples here: https://msdn.microsoft.com/en-us/query-bi/dax/summarize-function-dax 

 

At a glance, just go to "Modeling" and select "New Table". For your sample data it would be something like:

 

NewTable = SUMMARIZE(YourTable, YourTable[merchant-order-id], "Amount", sum(YourTable[Amount]))

 

In the formula above, "YourTable" should be changed to your current data table, which you did not mention. "New Table" could be renamed to anything you like. 

 

Regards. 

Hi Marco,

 

thank you for the solution. But I lose all the other columns, how can I keep all the other columns?

 

Best,

Pedram

Yes. Just add all the columns you want to keep here:

 

NewTable = SUMMARIZE(YourTable, YourTable[merchant-order-id], COLUMN1, COLUMN2, "Amount", sum(YourTable[Amount]))

 

PS.: if you think my answer solves your problem, don't forget to mark the post as solution. 🙂

Regards. 

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.

Top Solution Authors