Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Dynamic Date (30Days ago) and Dynamic Data Source error, no scheduler

Hi all,

 

i have a Odata API Call where i want to get only the last 30 days based on the Date Column "lastSeen", GT stand for "greater than".

The API CAll is:

"https://api.securitycenter.microsoft.com/api/machines?$select= id, computerDnsName$filter=lastSeen Gt 30DaysAgoDate"

The 30DaysAgoDate Value is dynamic. I use M-Code and it works on Power BI Desktop. 

filter=lastSeen Gt "& (Date.ToText(Date.AddDays(Date.From(DateTime.FixedLocalNow()), -31), "yyyy-MM-dd")

 

But it is a Dynamic Data Source and i can not turn on the scheduler,

when i publish the report.

If i would use filter=lastSeen Gt 2022-03-03, i wouldn´t get the error.,

but this is not dynmaic.

 

How can i get dynamic "last 30 days" and setting up ther scheduler in pbi online?

 

 

Thanks for your help.

 

 

2 Replies