Forum Discussion

JoseXaviHiguera's avatar
JoseXaviHiguera
New Member
2 years ago
Solved

OData URL filter based on current Date.

In the advance editor I had this query:

let
FechaInicioStr = "2023-07-27",
Source = OData.Feed("https://xxxx.crm.dynamics.com/api/data/v9.0/audits?$filter=createdon gt "
& FechaInicioStr
& " and action eq 64&$select=_objectid_value,createdon", null, [Implementation="2.0"])
in
Source

This runs ok, but i want to make the date change automatically everytime I refresh the data online.

 

FechaInicioStr =Date.ToText(Date.AddMonths(Date.From(DateTime.LocalNow()),-3), "yyyy-MM-dd"),

 

I made this change, and it runs ok on desktop, but when I programmed it online I get the following error:

 

This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. Learn more: https://aka.ms/dynamic-data-sources.

 

Does anyone knows how to automate the date to the current date when we update the data online?

  • JoseXaviHiguera's avatar
    JoseXaviHiguera
    2 years ago

    The solution in the link was with a merge, but with a Query inside OData.Feed works correctly, here's is the solution

     

3 Replies