cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
billybazinga
Frequent Visitor

Cannot convert value date to type Function

Hi everyone,

 

I have a function in my code which specifies today's date, under this form: Date.Today = Date.From(DateTime.LocalNow())

 

I have a new column with the following code returning the error on the screenshot and I can't for the life of me figure out what is going on. I have tried to add Date.From in front of Date.Today but to no avail. Any ideas?

 

 

if [Date_Receipted]<>Date.NotDelivered 
or Date.Year([#"Date_Promised (calculated)"]) > Date.Year(Date.Today)
then null 
else "Week "&Text.From(Date.WeekOfYear([#"Date_Promised (calculated)"])-Date.WeekOfYear(Date.Today()))

 

billybazinga_0-1656669984270.png

 

 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Issue is due to the fact that you have use Date.Today() which should have been Date.Today

1.png

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Issue is due to the fact that you have use Date.Today() which should have been Date.Today

1.png

Thank you very much, I obviously looked at this far too much and missed it 🙂

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Top Kudoed Authors