Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Manalytics
Regular Visitor

Insert a value into a table every refresh time

Hi guys,

 

I'm using pbixrefresh using Python to refresh my PowerBI Dashboard and publish into my account in PowerBI Service.

Now I am trying to audit the number of times that my dashboard is refreshed (the Python script runs every hour).

 

I can do this using Python but I'm trying a different approach... and my question is to know if is possible using a Insert Into/Output in PowerBI Query. Basically i'm trying this on my dataset:

UPDATE [Reports_HP].[dbo].[TESTE_PBI_UPDATE]
SET  [ID] =  1

UPDATE [Reports_HP].[dbo].[TESTE_PBI_UPDATE]
SET  [ID] =  [ID] + 1
OUTPUT inserted.[ID]

 

And I can do the audit under SQL side.

 

But I'm getting this error:

Microsoft SQL: Incorrect syntax near the keyword 'UPDATE'.
Incorrect syntax near ')'.

 

This is possible?

 

Thanks!

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

Hi @Manalytics,

 

Generally, in Power BI desktop SQL query can only be embedded into a source statement. And it is used to import data not modify.

 

1.PNG

 

So it is not possible to do Insert into/update in Power BI desktop. But you can do it at SQL side, then import the table into Power BI desktop.

 

Thanks,
Xi Jin.

 

View solution in original post

1 REPLY 1
v-xjiin-msft
Solution Sage
Solution Sage

Hi @Manalytics,

 

Generally, in Power BI desktop SQL query can only be embedded into a source statement. And it is used to import data not modify.

 

1.PNG

 

So it is not possible to do Insert into/update in Power BI desktop. But you can do it at SQL side, then import the table into Power BI desktop.

 

Thanks,
Xi Jin.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.