Forum Discussion
Custom Url parameters in Power BI
- 7 years ago
Hi mudassarhassan,
You can use URL filter, please refer to: https://docs.microsoft.com/en-us/power-bi/service-url-filters.
Regards,
Jimmy Tao
Hi mudassarhassan ,
Are you trying to replace the part of string to query the data of power bi report in your three-party app? If you are, you can use regular expression to achieve this, suppose you are using javascript, you can write a string replacement operation like below:
var str = "Product/Country eq 'US, Product/State eq 'TX'"; var res = str.replace(/([^a-zA-Z])/g, "").replace(/[product]/g, "").replace(/[eq]/g, "=");
Regards,
Jimmy Tao
Actually I will be calling Power BI Report from web-api which can pass parameters as country=us,state=tx rather than what Power BI Understands. If we have such parameters how can i apply filters to the report data??
- v-yuta-msft7 years agoCommunity Support
Hi mudassarhassan,
You can simply create some filters or slicers in your report. Then, suppose you are embedding your report into your website, just modify the embed configuration like below(set filterPaneEnabled as true):
var config= { type: 'report', tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed, accessToken: txtAccessToken, embedUrl: txtEmbedUrl, id: txtEmbedReportId, permissions: permissions, settings: { filterPaneEnabled: true, navContentPaneEnabled: true } };Regards,
Jimmy Tao
- mudassarhassan7 years agoFrequent Visitor
No Jimmy, that didn't work or fulfill my requirement
I want to filter the data in dashboard with country=usa, when someone tries to access the PowerBI Dashboard
https://app.powerbi.com/groups/me/reports/xxx/ReportSection?country=usa
- v-yuta-msft7 years agoCommunity Support
Hi mudassarhassan,
You can use URL filter, please refer to: https://docs.microsoft.com/en-us/power-bi/service-url-filters.
Regards,
Jimmy Tao