Forum Discussion
Export the data from tabular model
In tabular model I have more than one table, and they have relation
In each table I have created a features/flags
How Do I extract those features/ flags with key by maintiang the relation to sql server database ?
Ex:
Table1 - Key, Flag1,Flag2
Table 2 - Key, Fkey, Flg3,Flg4,Flg5
Table 3 - Key, Fkey, Flg6, FLg7,FLg8
My Output :
Key, Flg1,Flg2,FLg3,Flg4,Flg5,Flg6
In a database
You can use R script to write the data fields into a file. Please please refer to links below:
Use R to export data from Power BI (and Power Query)
Exporting data using RThen, still use R script the execute bulk insert to database from that file. See: How to quickly export data from R to SQL Server.
Regards,
2 Replies
- v-sihou-msftMicrosoft Employee
You can use R script to write the data fields into a file. Please please refer to links below:
Use R to export data from Power BI (and Power Query)
Exporting data using RThen, still use R script the execute bulk insert to database from that file. See: How to quickly export data from R to SQL Server.
Regards,
- malagariContinued Contributor
There's no way to directly export information from Power BI (or a Tabular Model) to a SQL Server database without some intermediate step.
You could pull Flg3, Flg4, Flg5, Flg 6, Flg7, and Flg8 into Table1 and then export that, which will be easier to import into SQL Server. Assuming that the foreign keys in Table2 and Table3 are pointing to Table1, you can make use of the RELATED() and USERELATIONSHIP() DAX functions to pull this information in.