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
Pikachu-Power
Impactful Individual
Impactful Individual

windsor.ai API / date question

Hello all,

 

i dont know if someone has experience with windsor.ai but I have one date question concerning the windsor.ai API:

 

I use windsor.ai to import Bing Ads data into Power BI via the created weblink like:

 

https://connectors.windsor.ai/bing?api_key=[your API key]&date_preset=last_7d&fields=campaign,clicks,spend,impressions,date,source&_renderer=csv

 

I would like to load all dates from 01.01.2020 until today in a dynamic way. Or last 3 years would be also ok. 

 

date_preset=last_2years is a possible value in the URL but there is no date_preset=last_3years. I could say "&date_from=2020-01-01" but that is not dynamic. After 10 years i would import all dates from 10 years.

 

How could I do that in the URL? Is it maybe possible to say TODAY - last_3years for the date_present field?

 

Many thanks.

 

Best Regards.

6 REPLIES 6
Adel
Helper III
Helper III

this has nothing to do with the connector, it's limited from bing ads, they don't allow pulling data older than 2 years, 

The solution here would be to use a data warehouse to get your historical data and then connect it to power bi.

details from bing here 
https://docs.microsoft.com/en-us/advertising/guides/release-notes?view=bingads-13

Pikachu-Power
Impactful Individual
Impactful Individual

@Adel but when I say "&date_from=2020-01-01" i get data older than two years. but it is not dynamic. you mean something like TODAY - 3 YEARS is not allowed from the bing ads webside? 

exactly yes, but i know that with windsor.ai you can pull historical data older than 2 years with almost all marketing platform you would need a data warehouse, and windsor.ai has it's own cloud so maybe that could help.

Pikachu-Power
Impactful Individual
Impactful Individual

Okay thats strange... windsor accepts

 

&date_from=2020-01-01

 

We acually just have to set the date dynamic. 

 

@artemus you didnt use "&date_from=". maybe there is the mistake?

@Adel thanks for yout alternative idea 

artemus
Microsoft Employee
Microsoft Employee

You can do this like:

"https://somewebsite.example/a/b/c?start=" & DateTimeZone.ToText(DateTimeZone.FixedUtcNow() - #duration(365 * 3, 0, 0, 0), [Format = "yyyy-MM-dd", Culture = ""]) & "&foo=bar"

Hi Artemus,

 

thanks for your reply. Something with the Format seems to be not ok:

 

Expected Token: Comma:

 

1.PNG

 

My whole query looks like:

 

= Csv.Document(Web.Contents("https://connectors.windsor.ai/all?api_key=[your API key] & DateTimeZone.ToText(DateTimeZone.FixedUtcNow() - #duration(365 * 3, 0, 0, 0), [Format = "yyyy-MM-dd", Culture = ""]) & fields=account_name,campaign,clicks,spend,impressions,date,adnetwork_conversions,&_renderer=csv"),[Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.None])

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.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.