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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors
Top Kudoed Authors