Guide: How to add Write-Back capabilities to your Power BI reports with Power Apps — Part 1
Introduction
Power Apps work great as a standalone tool for replacing your old spreadsheet with a more structured and cloud native data entry solution. However, what if I told you that:
Power Apps can be embedded into your Power BI Reports
Power Apps can display, and let user interact with, data coming from your Power BI report
Power Apps integrated in Power BI reports can be filtered by your users’ selections in Power BI
Power Apps can write data back to your Power BI data source, and create, edit and delete rows of data. Changes which can be shown instantly in the report!
In this article, I will cover how to get started with embedding Power Apps into your Power BI Reports, as well as provide a few examples of common use cases.
Getting Started with Embedded Power Apps
To get started with Embedded Power Apps, create a new Power BI Report in Power BI Desktop, or on the Power BI Service. Connect the report to your dataset, and create a simple visualisation. In this case, I’ve created a simple table.
TIP: If you started in Power BI Desktop, now is the time to Publish the file to your workspace, and open it in Edit Mode in the Power BI Service, as that will make it easier to author your Power Apps.
Next, insert a new Power Apps for Power BI visualization. This is a standard visualization type in Power BI. In order to send data from Power BI to Power Apps, drag any relevant fields from your Data Source onto the Fields list of your Power Apps visualization, just like you would with any other visualization in Power BI. You may choose to include Fields that you want to display and interact with, or any fields that you wish to be able to filter the App by. New fields can be added at any point, so don’t worry about forgetting any at this stage.
Once you start adding Fields to the visualisation, it should change design, and give you two options:
We are creating a new embedded Power App, and will as such select the “Create New” option. This prompts your browser to open up a new tab for the Power Apps editor, and it should show a simple app displaying a gallery with some of the data from your Power BI report displayed. This data is available in the App due to the PowerBIIntegration element that you can see in the Tree View of the app. This element can be called and treated like any other data source you would use in your Power Apps:
To test that all the building blocks are working as intended, create a new screen in your app. You can use a template, or create a blank screen. Just ensure that your new screen has a Gallery, and ensure that the ‘Items’ property of the gallery is populated with ‘PowerBIIntegration.Data’ (without the single quotes around it). This is the formula used to call and use the data coming from Power BI. Hence, try to add a new Text Label to your Gallery, and use ThisItem.YourFieldName as the Text property, using one of the Fields you added to the PowerApps visualization inside Power BI, in place of ‘YourFieldName’.
Finally, to test our very basic app, save and Publish the Power Apps, and jump back into Power BI. If you created your Report in the Power BI Service, make sure to save the report, before refreshing your browser page, otherwise you will need to recreate the report and/or Power Apps visualization as it will not save your changes. If you created your report in Power BI Desktop, you should publish the report to your workspace, to make testing of the Power App more seamless. After saving and publishing both the Power App and your Power BI Report, try refreshing the report page, and you should see your Power App render inside the report. Try out the interaction between Power BI and the Power App, by selecting a data point in your initial visualization, and check if the Power App is being filtered correctly.
Now you have all the basic building blocks for building Embedded Power Apps which interact with your Power BI Report. From here, you might modify your App to write new data to a data source, or even play around with having your App edit the data that your Power BI Report is based on.
Continue reading below for a few examples of Embedded Power Apps in practice.
Embedded Power Apps to power up report comment functionality
The Power BI Service does include comment functionality, but they are limited in functionality, and the comment data can’t be extracted and used elsewhere. A very simple Power App can be configured to write new comments to a data source, taking into account the filter context of your Power BI report, in order to better filter, display and use the comments for future analysis and decisions.
In this example, the Power App is used for creating, editing and displaying comments on Financial Statements, which are filtered by Department and YearMonth, to allow more granular commenting and analysis:
Embedded Power Apps with Direct Query connection to Power BI for live feedback
Another common use case is having Power Apps write data back to a data source like Dataverse or SQL databases, which allows Direct Query connection to Power BI. This makes it possible to visualize the data inputted with the embedded Power Apps live in the same Power BI report, increasing the potential for interactive reporting solutions.
Use case examples include Budget Engines, in which analysts may dynamically adjust input values to be picked up by complex calculations in Power BI, in order to test different forecasting scenarios. Or checklist scenarios, in which analysts can use the direct query functionality to check off items or assignments as they go along, dramatically enhancing the interactive potential of Power BI.
Summary
Data Entry requirements are notoriously difficult to satisfy with Self Service BI tools alone, but Power Apps integrated in Power BI reports provides a powerful and yet approachable way to get started. If you have questions or comments, you are always welcome to reach out.
Top comments (0)