Forum Discussion
Append
- 5 years ago
Hey Anonymous ,
sure. In Power Query click on the Query of the Excel that you don't want to load to the data model and unselect "Enable load":
Afterwards the Excel will still be refreshed and used for the other table, but this specific table from the Excel file will not appear in the Data Model.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
Hi Anonymous
You need to write some code in Power Query, for instance I created two excel files [File1 and File2] as following images:
Then I imported the file1 to the Power BI and open the Power Query, and changed the codes in the advaced Editor:
1- add the second file
2- align the columns names [in this exercise I just used Use First Rows as Headers [AKA "Promoted Headers"]
3- Append those 2 files
Codes are as below (Copy and pase this into the Advanced Editor on your computer and change file names and address)
let
Source = Excel.Workbook(File.Contents("C:\Users\doustimajdv\Desktop\Test\File1.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
A = Excel.Workbook(File.Contents("C:\Users\doustimajdv\Desktop\Test\File2.xlsx"), null, true),
Sheet2_Sheet = A{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers1" = Table.PromoteHeaders(Sheet2_Sheet, [PromoteAllScalars=true]),
#"Appended Query1" = Table.Combine({#"Promoted Headers1", #"Promoted Headers"}),
#"Sorted Rows" = Table.Sort(#"Appended Query1",{{"A", Order.Ascending}})
in
#"Sorted Rows"
the output will be as below:
Applied Steps:
Output Table:
Did I answer your question? Mark my post as a solution!
Appreciate your Kudos !!