Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

m code, table.buffer, power bi query editor, advanced editor

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). 

4 REPLIES 4
Anonymous
Not applicable

How can anyone find if using table.buffer is giving wrong or unexpected outpt?

dufoq3
Super User
Super User

Hi, why do you want to use table.buffer?


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Anonymous
Not applicable

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.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.