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

Adding rows in existing table based on a list that can be obtained from current table

Hi,

 

I am trying to use power query to automatically insert rows to existing table based on a list of dates that I can obtain from the existing table. The table has project name, date and amount. I am trying to sum up certain projects for each date.

 

Old Table:

Project      Date               Amount

proj1         1/1/2019        10

proj2         1/1/2019        10

proj3         1/1/2019        10

proj1         1/2/2019        20

proj2         1/2/2019        20

proj3         1/2/2019        20

 

New Table:

Project      Date               Amount

proj1         1/1/2019        10

proj2         1/1/2019        10

proj3         1/1/2019        10

proj1         1/2/2019        20

proj2         1/2/2019        20

proj3         1/2/2019        20

projSum    1/1/2019        30

projSum    1/2/2019        60

 

Can this be done?

Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can do this in Power Query, though I'm not 100% why you want to materialize this figure when a measure would be better suited, but maybe you have a reason.

 

You can see the applied steps, but quickly:

1. Duplicate original table

2. Group this table by Date, and Aggregating by Sum of Amount

3. Add a column named "Project" and enter in "ProjectSum"

4. Append your main table with table

5. Turn off "enable load" on the Append table

 

Final Table.png

 

file:

https://1drv.ms/u/s!Amqd8ArUSwDS3S0XTbCuNhNXsZvp?e=EEYRIf

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

You can do this in Power Query, though I'm not 100% why you want to materialize this figure when a measure would be better suited, but maybe you have a reason.

 

You can see the applied steps, but quickly:

1. Duplicate original table

2. Group this table by Date, and Aggregating by Sum of Amount

3. Add a column named "Project" and enter in "ProjectSum"

4. Append your main table with table

5. Turn off "enable load" on the Append table

 

Final Table.png

 

file:

https://1drv.ms/u/s!Amqd8ArUSwDS3S0XTbCuNhNXsZvp?e=EEYRIf

I got it working, thank you so much! The reason why I am doing this is because I need to mannually calculate some summary value for my report. I am trying to find some automatic method.

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.