Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
hi
i try to create an angular 2 application with Power BI Embedded report.
I create a dashboard with a Report level filter on a Function Table that is used to retrive the data.
I use this code, with javascript, to set the report
var m = {
action: "loadReport",
accessToken: response.AccessToken,
height: h,
width: w,
oDataFilter:'CountryRegion eq "United States"'
};but when the report is show the filter is not set (but work when the user click on it)
Any suggestion?
Thanks!
Solved! Go to Solution.
Both adding the parameter in JS or adding query in embeded URL work in my test.
In JS, a format as below should work, DO NOT mess the single quote and double quotes. You can add an alert to debug the passed JSON.stringified message.
oDataFilter:'CountryRegion eq "United States"'
oDataFilter: "<table>/<column> eq '<filtervalue>'"
One thing important is that <table>/<column> is case-sensitive. Make sure you've specified the correct names.
The filter needs to be set as a query string parameter on the embedURL.
thanks for your reply
i try this
iframe.src=response.Report.embedUrl +"&$filter=CountryRegion/CountryRegionName eq 'United States'";
but doesen't work....
Both adding the parameter in JS or adding query in embeded URL work in my test.
In JS, a format as below should work, DO NOT mess the single quote and double quotes. You can add an alert to debug the passed JSON.stringified message.
oDataFilter:'CountryRegion eq "United States"'
oDataFilter: "<table>/<column> eq '<filtervalue>'"
One thing important is that <table>/<column> is case-sensitive. Make sure you've specified the correct names.
thanks!
the problem was the single quote and double quotes!
Now all works!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |