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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

How to sum values in a column if they have the same ID in another column

Hi 

I want to add the weight column if they have same PO number.

For Eg.

The same PO have the weight categorized at item level. Below is a sample of data.

I want the total weight for each PO in a separate column So that later I can filter by removing duplicates.(I need the remove duplicates step because there are other columns in the data)

 Initial DataInitial Data

 Required ViewRequired View

2 ACCEPTED SOLUTIONS
drewlewis15
Solution Specialist
Solution Specialist

If you are looking to do this with M via the Query Editor, then you would just use Group By in the Transform tab and group by the PO#, adding one Sum column to get the total sum of weight and one "All Rows" column to bring back in your weight column.

 

 

PO Weight.png

You could then expand your AllRows column to bring back in the columns that you need.

Your final product would look like this:

 

PO Weight Final.png

 

 

 

View solution in original post

You should be able to bring back all other columns when you expand the new AllRows column right after the Group Rows step.

 

This screenshot should help... Just click the double arrows on the AllRows column, and then select all other columns that you want to bring back in.

 

PO.png

View solution in original post

6 REPLIES 6
drewlewis15
Solution Specialist
Solution Specialist

If you are looking to do this with M via the Query Editor, then you would just use Group By in the Transform tab and group by the PO#, adding one Sum column to get the total sum of weight and one "All Rows" column to bring back in your weight column.

 

 

PO Weight.png

You could then expand your AllRows column to bring back in the columns that you need.

Your final product would look like this:

 

PO Weight Final.png

 

 

 

Anonymous
Not applicable

Thanks a lot @drewlewis15

Anonymous
Not applicable

@drewlewis15 When I do this this removes the other columns in data. I have other column in the data as well.

@Anonymous

 

May be you could use a DAX Calculated Column

 

Wt =
CALCULATE ( SUM ( Table1[Weight] ), ALLEXCEPT ( Table1, Table1[PO#] ) )
Anonymous
Not applicable

@Zubair_Muhammad Correct me If I'm worng

We cannot see records if we have a DAX measure in our visual right?

You should be able to bring back all other columns when you expand the new AllRows column right after the Group Rows step.

 

This screenshot should help... Just click the double arrows on the AllRows column, and then select all other columns that you want to bring back in.

 

PO.png

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.