Data Studio
4.3K members online now
4.3K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Dat Studio DATE_DIFF function

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi all,

 

Does anyone knows hot to create a metric in Google Data Studio to calculate the days remaining for the current month, I was originally trying to use the function DATE_DIFF(X,Y) as follows:

 

DATE_DIFF (Date,'2017-03-31')

 

Thanks,

-Oscar

Re: Dat Studio DATE_DIFF function

[ Edited ]
Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

First, you're going to need to make sure what date range is your source schema.

 

This breakdown will help you understand this a little better: https://support.google.com/datastudio/answer/7037300?hl=en#input_formats

 

DATE_DIFF(TODATE(this_date, 'date_type', 'date_format'), TODATE(this_date, 'date_type', 'date_format'))

 

I hope this helps. Make sure you check you syntax.

Dat Studio DATE_DIFF function

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Michael, we are looking for the same thing but can't figure out what to put in the fields. Could you please make an example from your DATE_DIFF formula?

 

Thank you.

Dat Studio DATE_DIFF function

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi

 

I'm also looking for help, the formula as the example in data studio and on the support does not work for me, nor does Michael's example breakdown

 

Looking to calculate days remaining in the month based on the current date selected in date selector