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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Rolling 13 weeks average to update and replace with new data

Hi all,

 

I currently get a rolling 13 weeks file with updated sales each week split by category, subcategory and store. How do I upload these files each week to ensure that the latest file's data are overwritten with the new sales data? 

 

i.e.: Week 5: Sales of Cat A Store 1 is $100

the next week I receive a file that sales Sales of Cat A Store 1 Week 5 is $150 

 

Thanks

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

Hi @Anonymous ,

Please have a try.
Name the two excels with the same format and put them in the same folder.
Steps in Power Query:

  1. Get data in desktop: enter the folder path.
  2. Filter the excel files you want based on the creation date or modification date.
  3. Expand content to get data.
  4. Get the latest data when refresh.

More details; Automatically update data according to the date in the file name 

 

Best Regards

Community Support Team _ Polly

 

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

6 REPLIES 6
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

Please have a try.
Name the two excels with the same format and put them in the same folder.
Steps in Power Query:

  1. Get data in desktop: enter the folder path.
  2. Filter the excel files you want based on the creation date or modification date.
  3. Expand content to get data.
  4. Get the latest data when refresh.

More details; Automatically update data according to the date in the file name 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you! I will give it a try tomorrow.

v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

Could you please tell me what is your data source? If it is a CSV file, I agree with @hmahesh94 's way. Please refer to it. I have also found a blog, please refer to it to see if it helps you.

Import all CSV files from a folder with their filenames in Power BI 

  • It only worked on CSV files 
  •  If your CSV files contained crucial meta data in the filename, you “lost” that data after clicking the combine binaries button.

 

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.

 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Here are the 2 files. I can easily convert them to csv files. However I am not sure how do I upload them in Power BI and ensure the rows do not get duplicated.31.01.22 ext 10.01.22 extract 

hmahesh94
Helper I
Helper I

Hi @Anonymous 

 

Assuming you are connected to a CSV file:

   You can replace the previous weeks file with the updated file at the same location provided you won't be needing data from that file. Also, please remember to rename the file and the structure of the file should not be changed. Then, a simple refresh should update the underlying data.

 

The other way to approach this is to change the source of your file each week.

You may also go for a better solution by using Power Automate to deal with these situations.

Please feel free to ask for clarification. 
Cheers!

Anonymous
Not applicable

Thank you for your reply. If I were to replace the previous weeks file, wouldn't the data be duplicated i.e. 2 rows of the same data?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.