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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Building trends from multiple files

hello. thanks in advance for helping me. everyone here is always very helpful and quick to respond. I think this is going to be an easy one. 

I dump a daily report to a folder for pBI to trend. The file name is consistent with the date at the end of the name. For my example, the file names are salesdatayyyymmdd.csv. I dont need any help setting up trending. Im doing that elsewhere in reports and its working wonderfully....

My question is.... i have daily dump of consistently named files....

I want to pull the latest numbers from a table... but i also want to build a column that pulls yesterdays numbers, another column that pulls "last week's" numbers, and a column that pulls "last month's" numbers... in such a way that when i refresh every day, the numbers still follow "today", "yesterday", "last week", and "last month"...

Below are some sample tables with filenames:

new2pbix_0-1660573478206.png

 

new2pbix_1-1660573511878.png

 

new2pbix_2-1660573536032.png

Im sure there is some pretty simple DAX or M code that can dynamically pull todays date, todays date -1, todays date -7, and todays date -30? but skipping the weekends...   my powerBI report would looks somethng like this:

 

new2pbix_3-1660573641422.png

 

Youre awesome! thanks in advance!

6 REPLIES 6
mohammedshakeeb
Frequent Visitor

Hi @Anonymous , Did you ever find a solution for this? I have a similar sceniro. 

lbendlin
Super User
Super User

In Power Query use the folder connector. Ingest all the files (make sure to keep the file name around).  Then in Power BI create your report as needed.

Anonymous
Not applicable

Thanks for your reply. I am looking for a much more advanced answer though. I am using the folder option for quite a number of tables to build trending... but Im looking for specific coding examples of how to pull column data from multiple different files in a folder to show a table of data, historically. A dynamic column for "today", "yesterday", "last week", and "last month" using the rolling files for those dynamic days.

Provide sample data, and I can show you sample Power Query code.

Anonymous
Not applicable

i did, they are embedded in my original post

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.