![Exporting Model Data to CSV
or SQL Server in One Shot](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/2019-04-29_16-23-33.png?resize=688%2C640&ssl=1)
Replace 2021 March:
Now you can export the information direct from Energy BI Desktop utilizing my device, Energy BI Exporter. Learn extra right here.
In a few of my previous posts, that are the preferred ones, I defined tips on how to Export knowledge Energy BI Desktop or Energy BI Service knowledge to totally different locations like CSV, Excel and SQL Server. On this fast tip I clarify a very simple strategy to export the mannequin knowledge as a complete to both CSV or SQL Server with DAX Studio.
Daniil from XXL BI effectively defined this methodology, however I’d moderately rapidly clarify the way it works and add some extra data.
After launch 2.8 of DAX Studio, now you can rapidly export the entire mannequin to CSV and SQL Server in a single shot.
Enabling Export All Information in DAX Studio
- Open DAX Studio
- Click on “File”
- Click on “Choices”
- Click on “Superior”
- Tick “Present Export All Information button”
![DAX Studio Export Power BI Model Data Settings](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/2019-04-25_19-16-53-1024x658.png?resize=900%2C578&ssl=1)
Export Energy BI Mannequin Information to CSV
![DAX Studio Export Power BI Model Data to CSV](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/2019-04-29_19-25-09-1024x658.png?resize=900%2C578&ssl=1)
Export Energy BI Mannequin Information to SQL Server
Comply with the steps defined above, however this time choose “SQL Server” as vacation spot. For the “Connection String” observe the under steps to get it proper right away.
Generate Connection String with a UDL File
- Create a textual content file in your machine, you possibly can merely proper click on in any desired folder then “New” then click on “Textual content Doc”
![Create a TXT file](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/image-31.png?resize=546%2C444&ssl=1)
- Rename the file and swap .txt extension with .udl
![Rename TXT file to UDL](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/image-33.png?resize=294%2C126&ssl=1)
- Open the UDL file (double click on)
- From “Suppliers” web page, choose SQL Server OLE DB Supplier for SQL Server then click on Subsequent
- Enter Server Identify
- Sort in your SQL Server Person Identify and Password
- Tick “Permit saving password”
- Choose the vacation spot database
- Click on “Check Connection” button to verify the connection works then click on OK
- Now open the UDL file in Notepad
Person Connection String in DAX Studio
Now that we’ve generated the connection it’s time to use it in DAX Studio.
- Open the UDL file in Notepad
- Copy the connection string ranging from after the “Supplier” part
- Paste it in DAX Studio in “Connection String” field
- Enter a schema identify (it’s dbo in my case)
![Export Power BI Model Data to SQL Server](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/image-35.png?resize=689%2C505&ssl=1)
Issues
- When connecting to a Premium workspace you might face export failure because of question timeout
- When exporting knowledge to SQL Server
- if you happen to go away the “Schema Identify” clean you’ll get an error that vacant schema is just not allowed
- if you happen to enter an current schema identify the information will likely be exported to tables with very same identify as they’ve in your mannequin
- if you happen to enter a brand new schema identify then DAX Studio creates a brand new schema then generate the tables in that schema then exports the information
- whether or not you tick the “Truncate Tables” or not the present knowledge will likely be synchronised with the supply knowledge in Energy BI. (it doesn’t append knowledge)
- As you in all probability guessed, this methodology additionally works completely for exporting SSAS Tabular mannequin and Azure Evaluation Providers knowledge
![Exporting SSAS Tabular Model data to SQL Server with DAX Studio](https://i0.wp.com/www.biinsight.com/wp-content/uploads/2019/04/image-36.png?resize=529%2C822&ssl=1)