business-intelligencessas-tabular

Convert yyyyMMddhhmmss to datetime in dax(SSAS)


We want to convert a yyyyMMddhhmmss column to datetime format in SSAS. Thank you in advance for your help.


Solution

  • The answer I used. I hope it will be useful for you too.

    =format(DATE(LEFT([datetimekey],4),MID([datetimekey],5,2),MID([datetimekey],7,2))+TIME(MID([datetimekey],9,2),MID([datetimekey],11,2),MID([datetimekey],13,2)),"yyyy/mm/dd hh:mm:ss")