Forum Discussion

felix-chong's avatar
felix-chong
New Member
5 years ago
Solved

Text to Date

Hi there

 

I am new to BI and have the below format of table in Data.

 

SalesFYFM
5002021May
6002021Jun

skipped 50000 rows

 

System doesn't read it as date and i am struggled to compare. Could anyone advise please?

 

Thanks

F

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi felix-chong 

     

    You can use DAX or M, here is a column in DAX

     

    Date = DATEVALUE('Table'[FY]&"/"&'Table'[FM]&"/"&"1")

    And one in M

    Date.From( "1."&[FM] &"."&Text.From([FY]))

     

  • Hi Vera_33

    Thanks for the suggestions. 

    I tired and the following errors come up.How could i fix it please?

     

    Thanks

    F

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi felix-chong 

     

    You can use DAX or M, here is a column in DAX

     

    Date = DATEVALUE('Table'[FY]&"/"&'Table'[FM]&"/"&"1")

    And one in M

    Date.From( "1."&[FM] &"."&Text.From([FY]))

     

    • felix-chong's avatar
      felix-chong
      New Member

      Hi Vera_33

      Thanks for the suggestions. 

      I tired and the following errors come up.How could i fix it please?

       

      Thanks

      F

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi felix-chong 

         

        You need to change Table to your real table name...