Forum Discussion
BookMarks Functionality from Power BI to Power Apps
- 1 year ago
Hi Balakrishnan_J ,
You can achieve this outcome not by changing the Power BI bookmarks themselves, but by dynamically applying URL filters to the embedded Power BI report directly from Power Apps. This method allows you to filter the report based on user selections in your app, which provides the same experience as a dynamic bookmark.
First, you'll need to set up your app. Start by getting the base embed URL for your report from the Power BI Service by navigating to File > Embed report > Website or portal. Copy this URL. Then, in your Power Apps screen, add the user input controls you need, such as dropdowns for selecting the year and region. Finally, insert the Power BI tile from the Insert > Charts menu.
The key to this functionality lies in dynamically setting the TileUrl property of the Power BI tile you added. You will write a formula that combines your base URL with a filter query string. This string will be constructed using the values selected in your dropdown controls. The filter syntax uses the OData format, which looks like &$filter=TableName/ColumnName eq 'Value'.
"https://app.powerbi.com/reportEmbed?reportId=...&autoAuth=true&filterPaneEnabled=false" & "&$filter=SalesData/Year eq " & ddYear.Selected.Value & " and SalesData/Region eq '" & ddRegion.Selected.Value & "'"This formula concatenates several pieces to build the final URL. It starts with your base embed URL, then appends the &$filter= parameter to begin the query. It specifies the table and column to filter (e.g., SalesData/Year). Notice that the value for the year, which is a number, is taken directly from the year dropdown (ddYear.Selected.Value). The and operator is used to add a second condition. For the region, which is a text value, its value from the region dropdown (ddRegion.Selected.Value) must be enclosed in single quotes ' '.
Be careful with a few important details. The table and column names in the formula (SalesData/Year, etc.) must exactly match the names in your Power BI data model. If a name has a space, you must enclose it in single quotes in the URL string, like 'Sales Data'/'Product Name'. Also, always remember the syntax for data types: no quotes for numbers and single quotes for text values. Getting these details correct is essential for the dynamic filter to work.
Best regards,
Hi @Balakrishnan_J ,
Just wanted to check if you got a chance to review the suggestions provided and whether that helped you resolve your query?