Forum Discussion
Syndicate_Admin
Administrator
3 years agoPower BI API with Dynamics 365
Hello all, Dynamics SAAS environments limits data size for API calls. As a business analyst without IT/IS background I got things working to the below degree. An API call out of Power Query ...
v-jingzhang
Community Support
3 years agoHi
You can try something like this
let
pStartDate = Date.AddDays(DateTime.LocalNow(),-10), // 10 days prior of today
pEndDate = DateTime.LocalNow(), // today
urlString = "https://xxxxxxxxxxxxx and postingDate ge '" & Text.From(pStartDate) & "' and postingDate lt '" & Text.From(pEndDate) & "'",
Source = Json.Document(Web.Contents(urlString))
in
Source
The pStartDate and pEndDate may not be in the correct format that this API requires, you can use Date.ToText or DateTime.ToText function to change its format.
If you want to set scheduled refresh, above query will give you an dynamic data source cannot be refreshed error. In that case, you need to set RelativePath and Query options with Web.Contents(). Please refer to
Web.Contents with complex Query parameter names - Microsoft Power BI Community
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.