To publish your Power BI report online, you need to hard code the file's location for each table in Power Query to avoid dynamic data source error.


This can be achieved by following the simple steps given below:


Step 1:  Open your Power BI file in Power BI desktop: 

Step 2: Go to "Transform Data" on the ribbon on top and click on "Transform data" to open the Power Query Editor.


Step 3: Since, this steps needs to be reiterated for every table, select the first table from under the "Master Data Group" and click on "Advanced Editor" from the Home ribbon.



Step 4: Select the first 5 lines in the Advance Editor as shown in the below image:


Step 5: 

Paste below code.

Source = Excel.Workbook(Web.Contents(FileLocation), null, true),


Step 6: Repeat the steps 4 and 5 for all the tables under the "Master Data Group"