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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SMutlow
New Member

Passing a filter to an iFrame

HI there.

 

I have been tasked with testing the integration of Power BI with a Web App we are developing.

Using the code on github:
https://github.com/PowerBI/Integrate-a-tile-into-an-app

I have a SQL data source attached to a report in Power BI.

I need to filter the report at run time based on one of the columns and following the example here:
http://blogs.msdn.com/b/powerbidev/archive/2015/09/23/power-bi-api-updates-roundup.aspx

Specifically the example code:

https://app.powerbi.com/embed?dashboardId=c2411ca0-f4fc-4b6f-b2f1-02f62281290d&tileId=9a6b1f88-08b6-47c4-986d-d185b9fa9fbb}&$filter={FieldName} eq '{FieldValue}'

In your example above there is a curly bracket "}" just before "&$filter", I expect this is a typo?

The report is retrieved but the filter has not been applied.


As my column is an int I have tried:

iframe.src=embedTileUrl + "&$filter=tblDataSnapshot/StoreId eq " + storeId + "&width=" + width + "&height=" + height;

and

iframe.src=embedTileUrl + "&$filter=tblDataSnapshot/StoreId eq '" + storeId + "'&width=" + width + "&height=" + height;

Ive tried putting the filter both before and after the height and width code, removing the height and width code.

Ive tried &filter, &$filter and a 100 other variations of OData combinations.

 

Can I get some clarification on the correct syntax please?

10 REPLIES 10

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors