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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Change data source from CSV files to a MySQL Database.

Hi everyone, 

 

I have develop a prototipe dashboard with a lot of meassures and new columns from CSV files stored on my computer. Now, I need to move that prototipe into production. That means to change the datasource to a MySql Database containing the same tables and structures as the CSV files. Can anyone advice me on how to to that without having to build everything from scratch. 

Thanks in advance.

Andrés

@MFelix 

@v-lid-msft 

@amitchandak 

@Greg_Deckler 

@parry2k 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

When making this type of transformation what you need to assure is that the final table is the same.

 

My steps for this type oif changes are ussually:

  • Make a new query with the MySQL database
  • Check if the final result is the same number of columns, name of columns, formatting
  • If there are some additional calculations made on top of the CSV files my reference is that step not the final result
  • Then go to advance mode and copy the code from this query to the one of the CSV files.

 

For example let assume you have the transformation below (using current language and not M):

  • Open Folder
  • Filter Files
  • Add Custom column for treatment of CSV
  • Additional calculation based on columns of previous step

In this case I would create the the query for the final result to match the 3rd step and then replace those 3 steps by the one on the new query.

 

Again if you have the same column names and formats should work fine.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

I will first export the original pbix file as a template file.

Open template file and transform data.

Click "Advanced Editor" and modify the source.

(You can also connect to the database first, select and copy all the codes in the advanced editor, and replace the codes in the advanced editor of the template file).

You can click Apply button in Query Editor to apply change.

 

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

MFelix
Super User
Super User

Hi @Anonymous ,

 

When making this type of transformation what you need to assure is that the final table is the same.

 

My steps for this type oif changes are ussually:

  • Make a new query with the MySQL database
  • Check if the final result is the same number of columns, name of columns, formatting
  • If there are some additional calculations made on top of the CSV files my reference is that step not the final result
  • Then go to advance mode and copy the code from this query to the one of the CSV files.

 

For example let assume you have the transformation below (using current language and not M):

  • Open Folder
  • Filter Files
  • Add Custom column for treatment of CSV
  • Additional calculation based on columns of previous step

In this case I would create the the query for the final result to match the 3rd step and then replace those 3 steps by the one on the new query.

 

Again if you have the same column names and formats should work fine.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.