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
pjpreddy2
Frequent Visitor

calculate measure datediff

So I'm trying to calculate the number of days for this year, meaning 2/28/2018=the 58th day of the year.  I'm using Date Diff, but I keep getting a weird return.

 

I've tried:

 

DD = (DATEDIFF(1/1/2018,TODAY(),DAY))

 

and

 

DD = (DATEDIFF(TODAY(),12/31/2018,DAY))

 

both return a value of +/-43,159.

 

Any ideas on how to fix this?

 

PJ

1 ACCEPTED SOLUTION

@pjpreddy2

 

Try this

 

DD = DATEDIFF(Date(2018,1,1),TODAY(),DAY)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
pjpreddy2
Frequent Visitor

What I'm ultimately trying to do is calculate what the previous year did on our current date, meaning if 2/28/18=$10,000, I want to see what last year did on the same day.  SO I took the average daily balance from last year and wanted to multiply it by the day, to get the day's average. 

 

Might be a better way to do this so I'll take suggestions, thanks!!

@pjpreddy2

 

Try this

 

DD = DATEDIFF(Date(2018,1,1),TODAY(),DAY)

Regards
Zubair

Please try my custom visuals

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.