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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
JoseXaviHiguera
New Member

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?

1 ACCEPTED SOLUTION

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

 

View solution in original post

3 REPLIES 3
JoseXaviHiguera
New Member

The problem was not on the filter, but in looking for a DateTime.LocalNow(), do you happen to have another way of searching for a current date?

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

 

ppm1
Solution Sage
Solution Sage

Please see this article for how to avoid that error - OData.Feed And The Dynamic Data Sources Error In Power BI (crossjoin.co.uk).

Also, you could switch to Web.Contents and use the RelativePath option (links about that in that article too).

 

Pat

 

Microsoft Employee

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.