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
AiolosZhao
Memorable Member
Memorable Member

In Power Query Editor, how to add columns which need sum and group by?

Hi all,

 

I'm new to Power BI, so I really hope that you can tell me the solution step by step.

 

I have data like below :

KeyTypeAmount1Amount2
1A6010
1B3020
2A4020
2B7050
3A10090

 

Acutally I have a lot of "amount", "amount1,2,3,4,...", and in this example, I want to add 2 columns in Power Query Editor, like below:

KeyTypeAmount1Amount2New Amount1New Amount2
1A60109030
1B30209030
2A402011070
2B705011070
3A1009010090

 

Logic is, sum(amount1) group by key and type

 

I'm not familiar with the M Query, so I don't know how to add these 2 columns, please help!

 

Thanks in advanced.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




1 ACCEPTED SOLUTION
5 REPLIES 5
Anonymous
Not applicable

Hi 

 

You can use group by function to group with KEY and TYPE

 

image.png

 

 

image.png

Hi @Anonymous ,

 

thanks for reply, but after I use the group by, I won't have amount1 and amount2.

what I want is keep all column in table2 and add 2 columns.

 

Thanks.

Aiolos 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

thanks, that's what I want.

 

but unforunately, my data is too large, and when I use that method, it takes too long to apply the data.

 

do you have any other idea to solve that?

 

Thanks.

Aiolos





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AiolosZhao
Memorable Member
Memorable Member

Anyone can help to solve this question?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Top Solution Authors