Forum Discussion

badgeming's avatar
badgeming
Frequent Visitor
8 years ago
Solved

MySQL - how do I add another column to return the integer of the date

Hi, I have a DateCreated column coming from a MySQL dataset where the values are in dd/mm/yy hh:mm:ss.  I want to create another column that is just dd/mm/yy format without the hh:mm:ss bit (i.e an i...
  • Greg_Deckler's avatar
    8 years ago

    So, in DAX, you could create a new column with this formula:

     

    Column = INT([Date])
    
    

    Then, set this to "Date" as a Data Type in the Modeling ribbon.

     

    This works because DAX Date/Time is a numeric data type where the integer portion is the number of days from December 30th, 1899 and the decimal portion is the time component.

  • badgeming's avatar
    badgeming
    8 years ago

    Excellent, thank you