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
danialsj
Frequent Visitor

Power Query - Filtering rows and adding a column for subtotals based on two columns

Data:

Each 'Code' has multiple 'Amount' in a month. E.g. 1001 has two entries of 10 and 20 on 31st January.

 

CodeDateAmount
100131/1/1910
100131/1/1920
100128/2/1915
100128/2/1925
100231/1/1930
100231/1/1940
100228/2/1915
100228/2/1925

 

Requirement:

I want to make my data unique on the basis of 'Code' and 'Date' so that each 'Code' has one entry for each 'Date' and the 'Amount' is totalled up into a new column 'SubTotal'

 

CodeDateSubTotal
100131/1/1930
100128/2/1940
100231/1/1970
100228/2/1940

 

I need to do this in Power Query.

 

Thank you!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

hi @danialsj 

that's pretty much easy

right click on the Code field. then "Group by" then Advanced then Add grouping and Sum of Amount as new column. like this

878416.png

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

1 REPLY 1
az38
Community Champion
Community Champion

hi @danialsj 

that's pretty much easy

right click on the Code field. then "Group by" then Advanced then Add grouping and Sum of Amount as new column. like this

878416.png

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.