Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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 

 

 

 

 

 

 

  • 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.

2 Replies

  • 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.

  • V-lianl-msft's avatar
    V-lianl-msft
    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.