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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
nilo0123
New Member

trying to copy value into the same table but on differents rows based on id

Hi all,

I will try to be clear and by advance sorry for my english i'm french 🙂

I use power query editor because i work to set a dataset model.

 

I have a table with a lots of rows

For some type of rows i put calculate columns (working well)

For those rows I have a MAIN ID (reference to an another row contains into the same table

for all the rows I have a unique ID

 

I try to find a solution to "copy" the value of the calculate column into a new column for the main id

what i have

 

IDMAIN IDnumbertypeCALCULATE column (amount)
10123456contract0
21123456/av1addmendment2
31123456/av2addmendment4

 

What I want

IDMAIN IDtypeCALCULATE column (amount)
10contract6
21addmendment2
31addmendment4

 

After success to copy I will group by my result by main ID contract and it should be good

 

Thanx a lot for your help

and again sorry if i made some typo errors

best regards

3 REPLIES 3
v-xulin-mstf
Community Support
Community Support

Hi @nilo0123,

 

Is your issue solved?

If the issue has been solved, please share the solution and adopt it to help others.

Thanks! 😉

 

 

Best Regards,
Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

v-xulin-mstf
Community Support
Community Support

Hi @nilo0123

 

Sorry, i'm not clear about your expected output.

Could you provide more details?

 

Best Regards,
Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

HotChilli
Super User
Super User

How about this..

Duplicate the table.

Remove all columns except "MAIN ID" and the calc column.

Filter out rows where "MAIN ID" is zero.

Do a 'Group By' on "MAIN ID" and sum the calc column.

This will give you a 2 column table (let's call it MainTotals) with "MAIN ID" and total.

--------------

From the original table, do a Merge Queries (as New) on the original table and MainTotals , using Left Join on ID from the first table and "MAIN ID" from MainTotals.

You can then expand new column and you have the totals from the subitems on the same row as the 'primary' items.

You can total the new column and calc column as required.

Good luck

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.