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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Power BI My Datediff formula keeps on giving me blanks

Hello Everyone, 

 

I am trying to take a formula from excel and translate it into power Bi. It looks like it working but I am getting blanks

 

Jan 19 Open Age = If(AND('FreshService Data RAW'[Created Date]<= 1/31/2019,'FreshService Data RAW'[Resolved Date] > 1/31/2019),DATEDIFF(1/31/2019,'FreshService Data RAW'[Created Date],Day))
 
I would love somone help. why is my formula not working?
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous Try:

Jan 19 Open Age = If(AND('FreshService Data RAW'[Created Date]<= DATE(2019,1,31),'FreshService Data RAW'[Resolved Date] > DATE(2019,1,31)),DATEDIFF(DATE(2019,1,31),'FreshService Data RAW'[Created Date],Day))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Anonymous Try:

Jan 19 Open Age = If(AND('FreshService Data RAW'[Created Date]<= DATE(2019,1,31),'FreshService Data RAW'[Resolved Date] > DATE(2019,1,31)),DATEDIFF(DATE(2019,1,31),'FreshService Data RAW'[Created Date],Day))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  

Thank you so much for the help, I changed it a little to not get negative numbers but it worked perfectly. 

@Anonymous Yep.

 

"1/31/2019" is not interpreted as a date but rather the number (1 / 31) / 2019 = 0.00001597724 which is equivalent to 12/30/1899 12:00:01 AM as a datetime value.

Anonymous
Not applicable

That makes sense, Thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors