Forum Discussion
OData feed with Parameter Aliases not Working
hi RodneydeBeer ,
I was able to resolve this finally and documenting here if this may help someone.
In my case I was passing a filter that I wanted to pass dynamically based on the RangeStart and RangeEnd parameters so that I could configure the incremental refresh from the OData feed.
I was trying something similar like you, something like the below:
This resulted in the token error that you mentioned above. I tried replacing the $filter with filter but this did not work on the OData side and data was not being filtered.
Finally I decided to retry the above with a simpler approach and defined the OData feed using the standard way and selected my table. Then I just filtered tha OData table using the parameters RangeStart and RangeEnd and this worked.
Looks like the OData driver uses query folding to send the right filters to the server.
The code that works looks like below:
I used fiddler to track the url sent to the server and power bi sent the following url from the above to the backend
http://xxx/xxxtable_name?$filter=LastUpdatedOn ge datetime'2024-10-01T00:00:00' and LastUpdatedOn le datetime'2024-10-31T00:00:00' and Status ne ' '&$select=xxxxcomma_separated_list_of_columns_from_the_table
In your case above you could use a parameter of type text named text_parameter to filter the CreatedByUser, something like the below:
#"Filtered Rows" = Table.SelectRows(#"OData table", each Text.Contains([CreatedByUser], text_parameter))
OData will use query folding to send this filter the right way to the server.
Hope this helps !