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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sharpedogs
Advocate II
Advocate II

Hourly Updates multiple files from a folder -

I'm not sure what to do here?

 

1) I'm reporting against Server Utilization 

2) Each Hour there are 7 CSV files dropped into a folder 

3) I pull all files from the folder and merge them together so it's one large file and I repor on the data.

 

The data issue i just realized is that when the new reports come in, they are suppose to be for actvity between 4pm - 5pm, but the file always shows the prior time data as well. So it actually shows all the data points from 1am all the way up to 5pm. Then when the 6pm file comes in, it has all the data from 1am to 6pm. 

 

When i report on the data now, it's full of duplicates from the older files.

 

  

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @sharpedogs 

You could add a step "filtered rows",

Capture10.JPG

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each DateTime.Date([datetime])=DateTime.Date(DateTime.LocalNow()) and Time.Hour([datetime])<= Time.Hour(DateTime.LocalNow()) and Time.Hour([datetime])>= Time.Hour(DateTime.LocalNow())-1)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @sharpedogs 

You could add a step "filtered rows",

Capture10.JPG

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each DateTime.Date([datetime])=DateTime.Date(DateTime.LocalNow()) and Time.Hour([datetime])<= Time.Hour(DateTime.LocalNow()) and Time.Hour([datetime])>= Time.Hour(DateTime.LocalNow())-1)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
edhans
Super User
Super User

Just grab the latest file with each refresh. Make sure you use the Folder import option, then the Combine opreation, which it sounds like you are doing. That will prevent the import from looking at a specific file name.

 

Set this filter though right before the combine operation starts:

2020-03-08 10_10_53-C03 - Power Query Editor.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Greg_Deckler
Community Champion
Community Champion

So, not 100% clear. Are you saying that the 7 files get replaced each hour or get added to the folder?

 

Regardless, you should be able to filter based upon the time. You could do this dynamically by using a measure that grabs the MAX timestamp in the table. Then you just use that to include everything that has an hour of that measure - 1 hour for example. Would need to better understand your data adn report though. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors