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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hrics12
Frequent Visitor

Dynamic dates to pull GeoTab data into powerBI.

I'm trying to pull a table called "Trips" from GeoTab in an API call. When I set the search in the "params" equal to a date in the past it will pull the live data from that date to the current date. I need to be dynamic so it will always pull the data from 32 days ago. Everything i've tried just gives me blank data in the report. It also loads data from 2015. Does anyone know what to put and where to put some code in the advanced editor so it will always call for data from 32 days ago? Anything will be helpful

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi @hrics12 

 

What you can do in power query is to use a function that will always go back to the past 32 days. Here is an example below. Put this code below where you are passing the parameter

 

Date.AddDays(DateTime.LocalNow(),-32)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @hrics12 

 

What you can do in power query is to use a function that will always go back to the past 32 days. Here is an example below. Put this code below where you are passing the parameter

 

Date.AddDays(DateTime.LocalNow(),-32)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thank you! This is what I needed. I was just adding other stuff. This was simple and worked great

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors