Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
let
Source = Folder.Files("C:\Users\yd201\Desktop\Learning Power BI\MDS Files update"),
#"Inserted Text Between Delimiters" = Table.AddColumn(Source, "Date", each Text.BetweenDelimiters([Name], "_", ".", 2, 0), type text),
#"Replaced Value" = Table.ReplaceValue(#"Inserted Text Between Delimiters","_","/",Replacer.ReplaceText,{"Date"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Date", type date}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Descending}}),
#"Kept First Rows" = Table.FirstN(#"Sorted Rows",2)
in
#"Kept First Rows"
I want to use table.buffer, but I don't understand where I should use.
The folder has 6 excel file for the time being but every week one new excel file be added.
The first 4 columns of every file is static and remaining 35 columns are dynamic (every week one new date column having demand data will be added at last and one old date column from beginning will be removed, remaining columns data will be updated).
How can anyone find if using table.buffer is giving wrong or unexpected outpt?
I have learned somewhere that combining tables in query editor is = Appending. Now the output of #"Kept First Rows" = Table.FirstN(#"Sorted Rows",2) will be appended after combining (transformation). Before this step I will add a index column where 0= last weel data and 1= current week data (there will be a removed columns step when we click on combining). Indexing is done, so that I can compare between last week and current week data under 4 categories.
#"Kept First Rows" = Table.FirstN(#"Sorted Rows",2) After this query too I have to write further lines to modify my data.
and remaining things about the question is said in last question.
So someone said me to use Table.buffer after sorting , so whenever a new table will be added in the folder, I'll have as static table after sorting and giving first two rows as output .
So use table buffer after sorting 😉 Table buffer is only about speeding your query. But sometimes it can make your query slower. Try tu put table buffer after different steps and test it. It is only way.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!