Write Back into Azure SQL Database using Power BI in Power Apps

Write Back into Azure SQL Database using Power BI in Power Apps

Before getting into the specific subject of this article heading, will just recap platforms being used here:

Power BI – is the cloud based self-service platform which is used for data visualization and analysis 

Power App – is the no code / low code platform for developing business applications

Azure SQL DB – is the managed relational database service, used for storing and managing databases.

Power BI is being used extensively to connect of live data like Azure SQL to create easy-to-use dashboards, provides interactive reports, and delivers compelling visualizations.

However more often than not, people have repeatedly asks to update data through BI Visualization Tools. Though, it should be be done through business application while core objective of BI Solution has been in existence for report and information consumption layer

But, there are scenarios where end users still has requirements and needs that data should be updated through BI Interface with a seamless experience. Some of the examples be like updating Values related to Forecast, Budgets or adding Free Text Comments to the individual rows of records

New Power Apps Visuals Integration with Power BI comes to rescue for this requirements.

Using the PowerApps custom visual, you can pass context-aware data to a canvas app, which updates in real time as you make changes to your report. 

Following is a simple step by step tutorial for the same:

1.      Provision Azure SQL DB and configure a dummy database where we will use Comment is Blank and end user should have provision to give inputs into the comments

No alt text provided for this image

2.      Create a Sample Report using Power BI Desktop using Azure SQL DB as source with SalesOrderDetail Table.

No alt text provided for this image

3. Create Sample Report using customer ID and line total and import Power Apps Visual      

No alt text provided for this image

5.      Select fields (CustomeID, SalesOrderID ) in this case to be used and passed as reference into Power Apps

No alt text provided for this image

6.      Launch new Power Apps Creation Window from power BI Desktop, which will retain reference of the selected field for seamless interaction. Power App Screen is automatically created retaining Power BI Data Integration Reference and selected fields (Customer ID) are available here.

No alt text provided for this image

7. Add Edit Form for connecting with Azure SQL DB and add required fields like Sales Order ID and Comment (where Comments shall be updated). Also Update form Items formula as below to show selected values from customer ID;

No alt text provided for this image
No alt text provided for this image

Finally add Submit Button to update the form and some formatting changes for better look and feel

No alt text provided for this image

Finally Save and Publish Power App. Once Published it shows up in Power BI Desktop

Select a customer ID is selected from Power BI Visual, interactions are passed into Power Apps for updating of records.

No alt text provided for this image
No alt text provided for this image

Once Published same data input interactions are available on Power BI Portal for end user.

No alt text provided for this image

To summarize, this is how one can seamlessly interact with Power BI and Power Apps together while leveraging data management in Azure SQL so that data refreshes real time in the end user report as and when records are updated using embedded Power App.

Following resources can be referred to for more details :

PowerApps custom visual for Power BI

Connect to SQL Server from PowerApps

very nicely put up. thanks for sharing Aneek. Chandramauli Govind Rahul Jain FYI

Like
Reply

Great article Aneek Arora ! There is also a specialized solution that enables more comprehensive write-back to to Azure SQL database with 5 Power BI custom visuals: https://www.acterys.com It also automates creation of Azure SQL data models for various ERP and SaaS systems.

This is fantastic Aneek. In-Analytics data updates is the most desired feature in scenarios involving What-If Analysis, Planning and Budgeting and performance analytics (to capture comments and feedback). sravya potluri 

Like
Reply

To view or add a comment, sign in

More articles by Aneek Arora

  • Next Avatar of Data Flow !!!

    Have you ever been confused with all the buzz around Microsoft “Flows” that has been catching attention in application…

  • Speech and Language AI for Accessibility

    The contents of this article are my own personal opinions and is not intended to convey the official views of Microsoft…

Others also viewed

Explore content categories