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
10500438
Helper II
Helper II

M to append queries

I found a really good article about Merging queries using M, instead of having to import all the files then merge, using M you can do it all in one step. https://social.technet.microsoft.com/wiki/contents/articles/32915.power-bi-merge-query-with-m.aspx 

**one thing to note he is missing a "," in his code, but otherwise I tested it works.

 

 

Is it possible to do the same thing Appending queries? I have over 500,000 rows in each quarter and it takes forever to append these queries together. If possible, I would like to do it all at once. 

 

Thank you!!

1 ACCEPTED SOLUTION
10500438
Helper II
Helper II

I figured it out, not sure how feasible it since I have about 60 columns in the report. but it works

 

let
Source = Csv.Document(File.Contents("C:\Users\Documents\Development\test\one.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Column1", Int64.Type}, {"Column2", Int64.Type}}),
Source1 = Csv.Document(File.Contents("C:\Users\Documents\Development\test\one.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers1" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers1",{{"Column1", Int64.Type}, {"Column2", Int64.Type}}),

#"Appended Query" = Table.Combine({#"Changed Type", #"Changed Type1",two})
in
#"Appended Query"

View solution in original post

1 REPLY 1
10500438
Helper II
Helper II

I figured it out, not sure how feasible it since I have about 60 columns in the report. but it works

 

let
Source = Csv.Document(File.Contents("C:\Users\Documents\Development\test\one.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Column1", Int64.Type}, {"Column2", Int64.Type}}),
Source1 = Csv.Document(File.Contents("C:\Users\Documents\Development\test\one.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers1" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers1",{{"Column1", Int64.Type}, {"Column2", Int64.Type}}),

#"Appended Query" = Table.Combine({#"Changed Type", #"Changed Type1",two})
in
#"Appended Query"

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
Top Kudoed Authors