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

Error: We cannot convert the value #datetime() to type Date..

Exception: We cannot convert the value #datetime(2023, 5, 18, 0, 0, 0) to type Date..
when trying to convert or pass a date parameter into a query in power query mode. 
conversation syntax:

Date_text = Date.ToText(Date_value)
Date_value is of date data type. I've also tried using

  • Date_text = Date.ToText(Date_value, "mm/dd/yyyy")

  • Date_text = Date.ToText(Date_value, #duration(1, 0, 0, 0))

I am using direct query mode. 

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Try Date.ToText(Date.From(Date_value), "MM/dd/yyyy" ) instead

 

Pat

Microsoft Employee

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.