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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

AbhiSSRS

Power Automate Visual in Power BI - DML Capability to Power BI - Delete SQL records

Bring DML to Power BI with Power Automate – Delete Records

 

An exciting addition to Power BI April release is Power Automate Visual. This adds a host of capabilities to Power BI directly without relying on Power Apps. Users can now activate PA flows directly at the click of a button from Power BI passing necessary action values. This is not only restricted to operations like Send Mail or Create tasks but could also bring the Powerful Data Manipulation capabilities within Power BI. Here we take up a simple example to show how users can now delete records from Database with a click from Power BI :

 

Start with adding Power Automate Visual from AppSource

AbhiSSRS_0-1618943191762.png

 

 

Here we have a Skills table imported from SQL Server displayed on pbix. Now we add the PA visual

and map the field SkillID to the PA visual as we want that ID to be passed for deletion based on filtering on Power BI. Once mapped we click Edit on the PA visual and proceed :

AbhiSSRS_1-1618943191774.png

 

AbhiSSRS_2-1618943191781.png

 

 

Click New àInstant cloud flow . This takes to the flow editor within Power BI Desktop. Here select New Step and search for SQL Server , then add Delete Row

 

 

AbhiSSRS_3-1618943191784.png

 

AbhiSSRS_4-1618943191788.png

 

 

Here Configure the Delete Row to connect to the on-premise SQL Server we have populated data in power BI from and the table that we want to update. This would use the Gateway connection for an On-premise SQL Server in our case. The RowID field would prompt with the SkillID field that we have passed from Power BI , we need to select the same and the flow would then look like below :

AbhiSSRS_5-1618943191791.png

 

AbhiSSRS_6-1618943191794.png

 

 

Click Save and Apply and move back to the report:

AbhiSSRS_7-1618943191800.png

 

 

Now format the Power Automate Visual to display as a button by resize and button text properties.

AbhiSSRS_8-1618943191806.png

 

 

This is now ready for action :

Use filters to select the row that we want to delete. Eg. We select Skill ID 3 and click the Delete User which triggers the flow :

AbhiSSRS_9-1618943191807.png

 

 

Since ours is an import model, we can now refresh the report to see the record deleted. You may verify it from the SQL Table too.

AbhiSSRS_10-1618943191813.png