Advanced Filter/Parameter passing from Power BI to Power Apps

Introduction

I have written at length about how to create Power Apps embedded in Power BI / Fabric, applying write-back capabilities, and making the most of the integration:

However, recently I was faced with a challenge I had not seen before:

A simple comment App embedded in Power BI was supposed to show all the comments in a Sharepoint List which matched the filters set in Power BI. But…. Not all comments were showing up, even though the Sharepoint List only held about 10 comments at the time!

Why you ask? Well, the issue stems from the fact that the table of data being sent from Power BI to Power Apps, the PowerBIIntegration.Data object, has a hard limitation of 1000 rows. And those 1000 rows, is all that we get to work with.

See Power Apps visual for Power BI – Power Apps | Microsoft Learn for full limitations.

Hence, if you want to use the distinct values of one of the columns in the table as a filter in the Power App, you will also only be able to choose between the values which appear in the first 1000 rows of your table.

Here only Cat A and Cat B are visible in the Power App, despite all five categories being selected in Power BI.

And so the question arose: How can we consistently pass all the selected filter values from Power BI to Power Apps, when the table of data being sent to Power Apps is very large?

Solution: Concatenating filter selections and returning them on all rows of the table

The solution involves creating a Calculated Measure in Power BI, using a combination of the Values(), ConcatenateX(), and AllSelected() DAX formulas, to return a concatenated string of all the selected filters for a specific column, on all rows of the table.

This allows us to pick up all the values to be used as filters in the Power App, by simply querying First(PowerBIIntegration.Data), and using a little bit of Power FX to parse out the concatenated string in Power Apps.

First, the Power BI Formula:

The formula is not very complex, and takes advantage of ALLSELECTED() to remove the filter context coming from the visual itself, while still applying the context from the outside (the slicer).

Using this in Combination with VALUES(), allows us to grab all the values picked in the slicer, and stitch them together with CONCATENATEX(). Below is another screenshot with fewer selections:

Then, the Power Apps logic and the final result:

When we put this new Measure on to the Power Apps visual, we get all the filter values in the Power App:

And to split up the concatenated string, so that we get a table of values we could display, and/or use in a filter, we can use a Split() function:

And we can use this to consistently pass all distinct values in for our filter columns in Power BI to the app, even when the underlying table exceeds 1000 rows:

I’m curious if anyone out there have other clever workarounds that they use for the embedded Power Apps limitations. Please let me know!

Also check out these other blogs:

Bulk Write-Back w. Translytical Task Flows in Microsoft Fabric / Power BI: Writing a single value back to multiple records at the same time

Introduction On this blog we’ve previously covered quite a few areas of Translytical Task Flows: Having presented a few sessions on Translytical Task Flows at conferences in the past moths, there is one major recurring question: How do you write-back multiple records at once? If you ask me, the questions of bulk write-back/writing back multiple…

Fabric Quick Tips – Pushing transformation upstream with Self Service Views and Tables in Visual Queries for Lakehouses/Warehouses/SQL DB

Introduction Recently, I’ve experienced a huge influx in requests from Microsoft Fabric customers wanting a good way for user’s to push data transformation upstream, following Roche’s Maxim: Data should be transformed as far upstream as possible, and as far downstream as necessary. To elaborate slightly, there are tons of Power BI Semantic Models out there…

Organizing your Microsoft Fabric Data Platform: Tags and Task Flows

Introduction We’ve arrived at the final level of detail in our series on Organizing your Microsoft Fabric Data Platform. So far we’ve covered, from broadest to narrowest scope: This time we go all the way down to the Item level on our platform, and describe strategies for labeling and categorising individual items by using Tags…

Something went wrong. Please refresh the page and/or try again.

One response to “Advanced Filter/Parameter passing from Power BI to Power Apps”

Leave a comment