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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
HankScorpio
Frequent Visitor

Delete Data from model when file deleted from folder

Hi Everybody

 

Wanting to know how to configure PowerQuery in PowerBI to delete data from the data model when the file is deleted from the source folder. 

 

Currently I have set up a folder to consume some csv files. However, the source files may need to be replaced by newer csv files. Currently I am noticing that even when i delete files from the folder the data remains in the model. 

 

Would like it to delete data from the model when the source file containing it is deleted. How can I acheive this? 

3 REPLIES 3
HankScorpio
Frequent Visitor

Hi

 

I have deleted the csv file. I ran refresh in PowerWuery, is that the same as refreshing the model? 

Because I have done that and the data still remains even with the file gone. 

 

The only way I was able to get the data to delete was to change the source folder. But I can't do that every time. 

 

 

If you're doing all of this in PBI Desktop (assuming you're not using any Dataflows or datawarehousing of the CSVs) then you would need to:

1) Delete CSV

2) Go to the Home tab in the report view (not Power Query Editor) and hit Refresh:

BA_Pete_0-1711608168486.png

 

If your report has been published to the PBI Service then you would need to:

1) Delete CSV

2) Find the Semantic Model in the workspace and refresh that:

BA_Pete_1-1711608431632.png

 

Refreshing in the Power Query Editor just refreshes the previews in PQ, it doesn't refresh the model itself.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi @HankScorpio ,

 

The natural process of Power BI data refresh is to wipe all data from the model, reconnect to all sources in their curent state, and import the data as it exists at that time. Therefore, performing a refresh on each component of your data chain in the correct order will give you the results you're looking for.

For example, if you have 3 CSV files in a folder which are fed into a Dataflow for transformation, then imported into a data model, you need to follow the steps in this order:

Delete CSV file > Refresh Dataflow > Refresh data model. If your report is in the PBI Service, you may also need to use the Refresh Visuals button in your Service report, and/or refresh your browser. In very rare cases, you may also need to fully refresh your browser's cache as well.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors
Top Kudoed Authors