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
Anonymous
Not applicable

Cannot convert value '' of type Text to type Date

Hi  All

I am converting field Text to Date by using Dax Function "DateValue" but i got above message could you please advice proper solution. In My table i have a data '#' in date column then i relpace as null value ,after that i applied Date value function getting issue 

Mahamood218_1-1642396826324.png

 

Mahamood218_0-1642396699055.png

 

1 ACCEPTED SOLUTION

@Anonymous , As per @amitchandak suggestion  you need to add column name in else condition so this would be your idea code as suggested.

Column =
IF (
    'Table (2)'[Date] = BLANK ()
        || 'Table (2)'[Date] = "#",
    BLANK (),
    DATEVALUE ( 'Table (2)'[Date] )
)

 

Output:-

image.png

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous ,  Try a new column like

if([Date] ="" | | [Date] ="#", blank() , datevalue([Date]) )

Anonymous
Not applicable

Hi Amitchandak,

i appied the above syntax but getting empty data

Mahamood218_1-1642402999402.png

 

@Anonymous , As per @amitchandak suggestion  you need to add column name in else condition so this would be your idea code as suggested.

Column =
IF (
    'Table (2)'[Date] = BLANK ()
        || 'Table (2)'[Date] = "#",
    BLANK (),
    DATEVALUE ( 'Table (2)'[Date] )
)

 

Output:-

image.png

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hi 

@amitchandak  and @Samarth_18 now sysntax is working thanks for supporting

Mahamood218_0-1642414769022.png

 

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.