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
Anonymous
Not applicable

Append multiple CSV from SharePointFolder and transform table

Hi Guys

 

I am trying to append dynamicly some CSV-Files from a SharePointFolder. Means, whenever a new file is being saved in this sharepoint folder, I want to have the new data.

 

I already can get all the files from the folder. Now I just have to transform and combine the data.  

I am struggeling with the final steps in transforming: Since it is a CSV, i need to split the data, remove first row and set the (now new row) as header.  Maybe you guys can help me.

 

Get the CSV's from a SharePointFolder

 

 

 

let
    Source = SharePoint.Files("sharepoint-address", [ApiVersion = 15]),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Folder Path], "sharepoint-path")),
    #"FilteredContent" = List.Transform(#"Filtered Rows"[Content], each Transform(_)),
    #"Result" = Table.Combine(#"FilteredContent")
in
    #"Result"

 

 

 

Function "Transform"

 

 

 

let
    Source = (input) => Table.FromColumns({Lines.FromBinary(input)}),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4", "Column1.5", "Column1.6", "Column1.7", "Column1.8", "Column1.9", "Column1.10", "Column1.11"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", type text}, {"Column1.2", type text}, {"Column1.3", type text}, {"Column1.4", type text}, {"Column1.5", type text}, {"Column1.6", type text}, {"Column1.7", type text}, {"Column1.8", type text}, {"Column1.9", type text}, {"Column1.10", type text}, {"Column1.11", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"K", type text}, {"P", Int64.Type}, {"Time", type datetime}, {"Desc", type text}, {"A", type text}, {"B", type text}, {"C", type text}, {"D", type text}, {"Value", type text}, {"User", type text}, {"Q", type text}})
in
    Source

 

 

 

I do get a result, but the final steps (split, header row,...) are not applied. What am I doing wrong?

 

Best

Aleks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@reneton here is an excellent post that walks about this process.

Check out my latest blog post Year-2020, Pandemic, Power BI and beyond to get a summary of my favorite versions of Power BI features in 2020

I'd like to Compliments if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to congratulate anyone who has helped solve your problem. It's a show of thanks!

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultation.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@Anonymous glad it worked out for you, accept it as a solution so that others can find it useful as well.

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@reneton here is an excellent post that walks about this process.

Check out my latest blog post Year-2020, Pandemic, Power BI and beyond to get a summary of my favorite versions of Power BI features in 2020

I'd like to Compliments if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to congratulate anyone who has helped solve your problem. It's a show of thanks!

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultation.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Sweet 😁 Exactly what I needed!

Just modified the source and voilà.

 

Thank you very much.

 

Best

Aleks

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.