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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.