Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 

 

 

  • 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:-

4 Replies

  • Anonymous ,  Try a new column like

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amitchandak,

      i appied the above syntax but getting empty data

       

      • Samarth_18's avatar
        Samarth_18
        Icon for Community Champion rankCommunity Champion

        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:-