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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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