Forum Discussion

markmess77's avatar
markmess77
Icon for Resolver I rankResolver I
5 years ago
Solved

Way to convert integer to datetime with DAX?

I'm looking to convert my DateKey to a datetime datatype for a calculation. My DateKey is in yyyymmdd format and is stored as an integer. So for example, if I had a value of 20200701, I would want i...
  • Fowmy's avatar
    5 years ago

    markmess77 


    New Column = CONVERT(COMBINEVALUES("/",LEFT([DATE KEY],4),MID([DATE KEY],5,2),RIGHT([DATE KEY],2)),DATETIME)

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn