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
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
Custom2
Something 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