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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors