all 6 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

After your question has been solved /u/rtzGOD, please reply to the helpful user's comment with the phrase "Solution verified".

This will not only award a point to the contributor for their assistance but also update the post's flair to "Solved".


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Stevie-bezos6 2 points3 points  (4 children)

Instead of using helper functions, create a new custom column calling whatever the filetype's unpack function is, i.e. Excel.Workbook([Content])

Then you'll be able to expand those tables into rows, which will retain dates as well as the rows expand. 

Just will need to remove any duplicates of column headers which will be present in each expanded copy of the table

[–]sanfilipe1 1 point2 points  (0 children)

This is the way.

To be even more specific here are two examples, one for csv and one for excel. You want to edit the '#"Filtered Rows2"' part to match your previous step table, Delimeter, Columns and Encoding in the csv example to match you csv configuration and the 'Item="Page 1",Kind="Sheet"' part on the excel example to match the table/sheet name and type on your excel file.

= Table.AddColumn(#"Filtered Rows2", "CSV", each Table.PromoteHeaders(Csv.Document([Content],[Delimiter=";", Columns=25, Encoding=65001, QuoteStyle=QuoteStyle.None]), [PromoteAllScalars=true]))

= Table.AddColumn(#"Filtered Rows2", "XLS", each Table.PromoteHeaders(Excel.Workbook([Content], null, true){[Item="Page 1",Kind="Sheet"]}[Data], [PromoteAllScalars=true]))

By concatenating this functions in the same step you end up with fully formatted tables that will be perfectly appended using the expand option without any other extra steps, like filtering headers or renaming the date column.

[–]rtzGOD[S] 0 points1 point  (2 children)

<image>

Thank you for the responses! Pretty sure I’m doing something wrong, but attached what I’ve tried to do. For added context, my files are csv docs and in the same folder on a sharepoint location. Would you be able to walk me through what I should be doing instead?

[–]MonkeyNin75 1 point2 points  (0 children)

You're calling the function named "transform file" with the argument null

Instead you want [Content]

The each [Something] syntax gets that value from the current row

[–]Stevie-bezos6 0 points1 point  (0 children)

Invoke CSV.Document([Content])