locked
How to convert number to ( string ) date ? RRS feed

  • Question

  • Hi , i have number like 20140629 and i want to get it as string like "20140629"  and as a date  like 29/06/2014 ,

    how can i do it using DAX ?


    yaniv012 from M.S.

    Thursday, February 19, 2015 11:19 AM

Answers

  • To convert number to date you can use the FORMAT function. You can format it to your specific date according to this page.

    Numbers are implicitly converted to text when you apply functions that returns text.


    • Edited by Gil RavivMVP Thursday, February 19, 2015 2:26 PM
    • Marked as answer by yaniv012 Sunday, February 22, 2015 1:11 PM
    Thursday, February 19, 2015 2:24 PM
  • =DATEVALUE(FORMAT(20140629,"0000-00-00"))
    • Marked as answer by yaniv012 Sunday, February 22, 2015 1:11 PM
    Thursday, February 19, 2015 10:02 PM

All replies

  • To convert number to date you can use the FORMAT function. You can format it to your specific date according to this page.

    Numbers are implicitly converted to text when you apply functions that returns text.


    • Edited by Gil RavivMVP Thursday, February 19, 2015 2:26 PM
    • Marked as answer by yaniv012 Sunday, February 22, 2015 1:11 PM
    Thursday, February 19, 2015 2:24 PM
  • =DATEVALUE(FORMAT(20140629,"0000-00-00"))
    • Marked as answer by yaniv012 Sunday, February 22, 2015 1:11 PM
    Thursday, February 19, 2015 10:02 PM
  • thanks gil !

    yaniv012 from M.S.

    Sunday, February 22, 2015 1:12 PM
  • thanks mark - much help 2 me !

    yaniv012 from M.S.

    Sunday, February 22, 2015 1:13 PM