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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
SamuelTesf
Helper I
Helper I

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

@SamuelTesf 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@SamuelTesf 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  

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

@SamuelTesf 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.

That makes sense, Thank you!

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors