Forum Discussion
Writing Calculated Visualization Back to SQL Table
- 4 years ago
ninsights if you have published this on a SSAS server (pbi workspace for example), you can write a PQ where you query the same SSAS server and utilize the same DAX query that generates this viz and try to write back the results in a SQL table.
An example of SQL write back with PQ
let Source = Sql.Database("myserver", "newtest"), emailVal = "[email protected]", Custom1 = "INSERT INTO [newtest].[dbo].[Table_1] (Email) VALUES('" & emailVal & "')", Custom2 = Value.NativeQuery(Source, Custom1) in Custom2Something like this
let
Source = Sql.Database("myserver", "newtest"),
SSAS query = SSAS Q with DAX query,
Val = convert the SSAS query to SQL insert row,
Custom1 = "INSERT INTO [newtest].[dbo].[Table_1] (Email) VALUES('" & Val & "')", Custom2 = Value.NativeQuery(Source, Custom1)
in Custom2
Hi ninsights ,
Agree with AlexisOlson statement. Power BI is a collection of software services, apps, and connectors that work together to turn your unrelated sources of data into coherent, visually immersive, and interactive insights. Writing the visual part of the code back to sql does not seem to be a routine operation.
Best Regards,
Henry