Forum Discussion
Frixel
5 years agoPost Prodigy
convert Timestamp
Hi, I have in my file a colomn with TimeStamps like this. as you see the date is a mix of 8 digits, 9 digits or 10 digits. I want try to make colomn`s Date & Time Colomnn How c...
- 5 years ago
Frixel Try the following:
Date Column = VAR __Date = SUBSTITUTE(LEFT([Column1],SEARCH(" ",[Column1],,0)),"(","") VAR __FirstHyphen = SEARCH("-",__Date,,0) VAR __SecondHyphen = SEARCH("-",__Date,__FirstHyphen+1,0) VAR __Day = LEFT(__Date,SEARCH("-",__Date,,0)-1) VAR __Month = MID([Column1],__FirstHyphen+2,__SecondHyphen - __FirstHyphen - 1) VAR __Year = RIGHT(__Date,LEN(__Date) - __SecondHyphen) VAR __NewDate = __Month & "-" & __Day & "-" & __Year RETURN __NewDatePBIX is attached below sig. Table (17a)
Frixel
5 years agoPost Prodigy
Great, it conferts now the time and date.
But...
The problem is now is that the date is reversed, if you know what i mean.
1st row 1st colomn = 1 July 2020 etc
Greg_Deckler
5 years agoCommunity Champion
Frixel Try the following:
Date Column =
VAR __Date = SUBSTITUTE(LEFT([Column1],SEARCH(" ",[Column1],,0)),"(","")
VAR __FirstHyphen = SEARCH("-",__Date,,0)
VAR __SecondHyphen = SEARCH("-",__Date,__FirstHyphen+1,0)
VAR __Day = LEFT(__Date,SEARCH("-",__Date,,0)-1)
VAR __Month = MID([Column1],__FirstHyphen+2,__SecondHyphen - __FirstHyphen - 1)
VAR __Year = RIGHT(__Date,LEN(__Date) - __SecondHyphen)
VAR __NewDate = __Month & "-" & __Day & "-" & __Year
RETURN
__NewDate
PBIX is attached below sig. Table (17a)
- Greg_Deckler5 years agoCommunity Champion
Frixel I'm not sure what you mean by that. DAX calculated columns are always tacked onto the end of a table.
- Frixel5 years agoPost Prodigy
Greg_Deckler Thanks,
It seems now i have the right Date format.
Can i now also move the Colomns date and Time on a other place?
I can`t find a option to move colomns to an other place