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
jtao7387
New Member

Power Query Consolidation Question

Dear Power Query Experts,

 

I have a question on 'selective consolidation' of 2 files into 1 file. 

 

THe Issue: (Refer below screen shot): 

- Excel file 'Book 2' is the original file with 5 columns - Mat No; A; B; C; D

1.jpg

 

- Now, the business submits another file called 'Book 2 - updated' to make some changes to 'Book 2'. Lets say they only want to amend cell C3 and cell D4 so they only change the value of these 2 cells to a new value (red line highlight in screen shot)

2.jpg

- The other cells in 'Book 2-updated' are left as blank which means NO DATA CHANGE.

 

Question:

How can I combine "Book 2" and "Book 2 - updated" using Power Query so the consolidated file only updates cell C3 and D4 (where the data has changed) and keep the original data as is based on 'Book 2'? My final consolidated sheet should show all data as per 'Book 2' except the data updated in cell C3 and D4 as per 'Book 2 - updated'.

 

The reason the business doesn't want to re-enter all the values (showing 'null' in screenshot) that hasn't changed, is because it creates unnecessary work and may cause data entry errors. So they only submit those cells where data has changes (eg. cell C3 and D4).

 

Capture.JPG

thank you in advance, appreciate a quick reply.

Jack

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @jtao7387 ,

 

My workaround works but is not easy enough.

Here're the steps.

First separate the two tables based on the source name and merge.

vstephenmsft_5-1669961700920.pngvstephenmsft_6-1669961708736.png

 

Expand the column needed.

vstephenmsft_7-1669961720623.png

vstephenmsft_8-1669961790548.png

 

Then add two conditional columns to substitue.

vstephenmsft_9-1669961804918.png

vstephenmsft_10-1669961813537.png

vstephenmsft_11-1669961830698.png

Remove the columns unneeded and rename the conditional columns.

vstephenmsft_12-1669961908284.png

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

4 REPLIES 4
v-stephen-msft
Community Support
Community Support

Hi @jtao7387 ,

 

My workaround works but is not easy enough.

Here're the steps.

First separate the two tables based on the source name and merge.

vstephenmsft_5-1669961700920.pngvstephenmsft_6-1669961708736.png

 

Expand the column needed.

vstephenmsft_7-1669961720623.png

vstephenmsft_8-1669961790548.png

 

Then add two conditional columns to substitue.

vstephenmsft_9-1669961804918.png

vstephenmsft_10-1669961813537.png

vstephenmsft_11-1669961830698.png

Remove the columns unneeded and rename the conditional columns.

vstephenmsft_12-1669961908284.png

 

 

Best Regards,

Stephen Tao

 

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

jtao7387
New Member

HI KNP,

 

thanks for your reply. If you "Filter out any nulls as required" would Power Query keep the nulls values as the original file version and only replace the cells (C3 & D4) in the consolidated version?

 

I can't find where i can upload the excel files? could you please let me know?

 

thanks,

Hi @jtao7387,

 

I'm really sorry, I missed your reply.

Upload files to OneDrive or similar and share.

It's quite a complex question, so rather than try to answer in theory, I'd rather have files to work with. 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
KNP
Super User
Super User

(I'm answering from my phone so can't provide an example at the moment)

I would look at keeping either the created or modified date time from the files.

Use this date time to identify the latest version.

Filter out any nulls as required.

If you can provide a couple of sample files or data to work with it would be easier to answer.

Let me know if you have any questions about this method, I'll see if I can provide an example when I'm back at my computer.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

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