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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.