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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RodneydeBeer
Frequent Visitor

OData feed with Parameter Aliases not Working

Hello.

I am following this blog that has been refered to in other threads on this forum.

Using OData.Feed and the Query option to avoid the dynamic data sources error in Power BI (crossjoin...

 

The parameter is however not being substitued into the Odata query string.

My Power Query:

RodneydeBeer_0-1707417640037.png

and then the result:

RodneydeBeer_1-1707417682010.png

 

Has anybody got advise please?

Many thanks

Rodney

 

 

 

 

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @RodneydeBeer ,

 

You can try the below points first that are often the cause of issues like the one you're experiencing.

The error (400) Bad Request with the invalid filter expression 'CreatedByUser eq@p' suggests that there is an issue with the syntax of the filter expression you are using in your API request.

To address this issue, please ensure the following:

1.Correct Filter Syntax: The filter expression should follow the Power BI API's expected syntax. A proper filter expression would look like Table/Field eq 'value'. For example, if you're filtering by a user who created a report, it should be something like:

CreatedByUser eq 'JohnDoe'
Replace 'JohnDoe' with the actual username you want to filter by.

2.Parameter Usage: If you are trying to use a parameter in your filter, ensure that you are passing the parameter value correctly. The @p notation is not recognized as a proper way to pass parameters in the filter expression for Power BI's exportToFile API. Parameters should be explicitly defined in the API call.

3.Check Field Names: Verify that CreatedByUser is the correct field name within the dataset you are trying to filter. If the field name is incorrect, the filter will not work.

 



 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Hi Stephen. Thanks for replying.

The idea is to build the Odata query using dynamic values as described in the blog I mentioned. 

The way to use Parameter aliases is described here:

Query options overview - OData | Microsoft Learn

 

RodneydeBeer_0-1707720420957.png

I am trying to figure why the paramter is not being substituted into the query, when I run it.

If I use hardcoded values in the query it works fine.

 

Rodney

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors