Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi All.
I've run into an error when I append two queries/tables in PowerQuery:
It's worth noting the two tables/queries I'm appending have a custom function. I'm using the function so the query can iterate through a list of excel paths and sheets.
Query 1:
let
Source = Excel.Workbook(File.Contents("C:\Users\Sabastian.Chetty\Desktop\Paths - M code - Finance Reports.xlsx"), null, true),
fnSMU_Sheet = Source{[Item="fnSMU",Kind="Sheet"]}[Data],
//Cleaning Starts Here:
PromotedHeaders = Table.PromoteHeaders(fnSMU_Sheet, [PromoteAllScalars=true]),
InvokedCustomFunction = Table.AddColumn(PromotedHeaders, "SMU_Excel_File_Cleaner", each SMU_Excel_File_Cleaner([Paths], [Sheet Name])),
ExpandedSMU = Table.ExpandTableColumn(InvokedCustomFunction, "SMU_Excel_File_Cleaner", {"Parent Category", "Cost Category", "Month", "Value", "Department", "Management Unit"}, {"SMU_Excel_File_Cleaner.Parent Category", "SMU_Excel_File_Cleaner.Cost Category", "SMU_Excel_File_Cleaner.Month", "SMU_Excel_File_Cleaner.Value", "SMU_Excel_File_Cleaner.Department", "SMU_Excel_File_Cleaner.Management Unit"})
in
ExpandedSMU
Query 2:
let
Source = Excel.Workbook(File.Contents("C:\Users\Sabastian.Chetty\Desktop\Paths - M code - Finance Reports.xlsx"), null, true),
fnAMU_Sheet = Source{[Item="fnAMU",Kind="Sheet"]}[Data],
// Cleaning Starts Here:
PromotedHeaders = Table.PromoteHeaders(fnAMU_Sheet, [PromoteAllScalars=true]),
InvokedCustomFunction = Table.AddColumn(PromotedHeaders, "AMU_Excel_File_Cleaner", each AMU_Excel_File_Cleaner([Paths], [Sheet Name])),
ExpandedAMU = Table.ExpandTableColumn(InvokedCustomFunction, "AMU_Excel_File_Cleaner", {"Parent Category", "Cost Category", "Month", "Value", "Department", "Management Unit"}, {"AMU_Excel_File_Cleaner.Parent Category", "AMU_Excel_File_Cleaner.Cost Category", "AMU_Excel_File_Cleaner.Month", "AMU_Excel_File_Cleaner.Value", "AMU_Excel_File_Cleaner.Department", "AMU_Excel_File_Cleaner.Management Unit"})
in
ExpandedAMU
After running I am able to append these into a single table, I used the UI and get the following code:
let
Source = Table.Combine({fnSMU, fnAMU})
in
Source
After all of these steps I get the error listed at the start of this post.
I did some digging and found that two sources may be causing the issue so I followed the steps in the following article with no luck: https://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/
Any idea where I'm going wrong?
Solved! Go to Solution.
Hi @Sabo256w ,
Please try the solutions provided in this blog:
Here is a similar thread:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Eyelyn!
Works perfect 😀
Hi @Sabo256w ,
Please try the solutions provided in this blog:
Here is a similar thread:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Brilliant!!!!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 6 | |
| 6 | |
| 5 |