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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
briannoyes
Regular 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
v-jiascu-msft
Employee
Employee

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.

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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