What will happen if you import data from a particular location to the report, but the files have been moved away from that location accidentally. Then you will get an error saying that, the files are missing. Do not worry there is an easy way to overcome this by using Data Source Settings in Power BI.

This blog explains an easy method to fix this error.

First, I imported two excel files from my Desktop as follow.

Imported Data files from Desktop
Figure 1: Imported Data files from Desktop

Now I purposely move my files to a new folder in my D Drive.

Moved csv files from Desktop to D drive
Figure 2: Moved csv files from Desktop to D drive

Now I refresh my Power BI report as follow.

Click on refresh
Figure 3: Click on refresh

I get the below message saying that I can’t refresh since the files are missing from its location.

File Missing Error
Figure 4: File Missing Error

The error message is as follow.

Error message for missing files
Figure 5: Error message for missing files

To overcome this issue, click on the down arrow of Transform data (in the Power BI ribbon), there you can find the Data Source Settings. Select the Data Source Settings option.

Data Source Settings in Transform Data tab
Figure 6: Data Source Settings in Transform Data tab

Then the following window pops up containing the previous data source locations.

Now select one path and click on Change Source as follow.

Previous data source locations
Figure 7: Previous data source locations

Then browse the new file location as shown below.

Click on browse
Figure 8: Click on browse

Select the file in the new location.

Select the file in the new location
Figure 9: Select the file in the new location

Now you will be redirected to the previous window with the updated file location as follow. Click on OK.

Updated source location
Figure 10: Updated source location

Now you can see the updated location in the Data Source Settings window.

Updated source location in Data Source Settings
Figure 11: Updated source location in Data Source Settings

Follow the same steps to other files as well.

After changing the location of other files, the final view of the Data Source Settings display as follow.

Final view of the Data Source Settings
Figure 12: Final view of the Data Source Settings

 

Click on Apply Changes to apply the Data Source Changes to the Power BI Report.

Click on Apply Changes
Figure 13: Click on Apply Changes

Now when you click on Refresh you do not get the error message. The data gets refreshed uninterruptedly.

Refreshes without Error
Figure 14: Refreshes without Error

 

Please note that you can find the Data Source Settings in the Power Query Window as well.

Data Source Settings in Power Query Window
Figure 15: Data Source Settings in Power Query Window