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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wewa
Regular Visitor

Can't refresh OData feed because of dynamics url

I have run into trouble getting my data to refresh online outside of Power Bi Desktop. The offending query retrieves a table of all logins made during the past 2 months up to a max of 100000.

 

When I try to schedule refresh the following Data source:

 

Source = OData.Feed("https://xxxx.api.crm4.dynamics.com/XRMServices/2011/OrganizationData.svc/AuditSet?$select=UserId,ObjectId,Action,Operation,CreatedOn&$filter=(Operation/Value eq 1) and (CreatedOn ge datetime'" & DateTime.ToText(Date.AddMonths(DateTime.LocalNow(),-2), "yyyy-MM-dd") & "')&$top=100000")

 

I get the error:

"You can't schedule refresh for this dataset because one or more sources currently don't support refresh."

 

When I remove  and (CreatedOn ge datetime'" & DateTime.ToText(Date.AddMonths(DateTime.LocalNow(),-2), "yyyy-MM-dd") & "')

 

modifing the URL to:

Source = OData.Feed("https://xxxx.api.crm4.dynamics.com/XRMServices/2011/OrganizationData.svc/AuditSet?$select=UserId,ObjectId,Action,Operation,CreatedOn&$filter=(Operation/Value eq 1)&$top=100000")

The error dissapears.

 

It looks like the dynamic part of my URL doesn't work online. Will this be made possible in the future? Or is there a work arround?

3 REPLIES 3
Vinothsusai
Helper III
Helper III

Hello,

I am facing same issue. Do you have any solution for this?. Please advise.

 

 

Thanks

Thanks Tishchenko, that really helped clear up how this should work.

 

I am still running into an error though, so I can't accept your answer yet. I checked the documentation for OData.Feed and the same Query option is available. When I modify the query to:

 

Source = OData.Feed("https://xxxx.api.crm4.dynamics.com/XRMServices/2011/OrganizationData.svc/AuditSet?$select=UserId,ObjectId,Action,Operation,CreatedOn&$filter=1&$top=100000", [Query=[filter="(Operation/Value eq 1)"]])

I get the error:

Expression.Error: OData: The header with name 'Query' has a value type 'Record' that is invalid. Only DateTime, Logical, Number, and Text are supported.

 

I think Power Bi is parsing the Query option as a Header option. How do I skip the Header option?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors