cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
briannoyes Frequent Visitor
Frequent Visitor

Passing parameters to OData API data source

I need to implement Power BI reports driven by an OData API that we will implement. These reports will be displayed in our SaaS application using Power BI Embedded.

 

In order to properly filter what that endpoint returns, I need to be able to pass the user id (which I think I can pass as the "username" and EffectiveIdentity, but not sure how to get that passed to the OData endpoint?), as well as one or two other filtering parameters.

Is there any documentation or samples available for passing parameters to an OData API data source?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Passing parameters to OData API data source

Hi @briannoyes,

 

The OData source accepts filters indeed. Please refer to OData V4 and OData V2. But there are two things we should concern.

1. I'm afraid we can't pass the USERID to the query if it's the login user. Please refer to How-we-can-pass-dax-function-username-to-sql-query-query-to/ and 4-ways-to-get-username-in-power-query/.

2. There could be more than 1 user in your scenario. So updating the dataset (reload according to the login user) couldn't be a good idea. Because the embedding consumers have the same dataset at the same time. The solution could be developer/embedded-row-level-security.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
briandnoyes Occasional Visitor
Occasional Visitor

Re: Passing parameters to OData API data source

Hi @v-jiascu-msft
Thanks for the reply. I came across what I think you are referring to in some docs this weekend. So if I understand it right, once Power BI (even embedded) loads and populates the report once, does it pull the data from the data source and cache it for subsequent calls to render the report and does not go back to the data source again? That seems like it would kill the whole idea of connecting to live data.

What about other kinds of filter parameters other than username? I can probably do the filtering based on USERNAME in Power Query as shown in this video (https://azure.microsoft.com/en-us/resources/videos/managing-authentication-and-authorization-for-pow...). But I'll also need to be able to pass in a parameter that is used to render a report based off a selection in the app. So how does that work in terms of dynamically rendering the report based on both who the user is (filtering what data gets rendered) as well as what the root set of data is based on an app selection (not a slicer, but UI selections in the app that is embedding Power BI)?

 

Thanks

Brian