Forum Discussion
Anonymous
6 years agoNot applicable
Get date from string
Hello, I have a string in the below format Im trying to get from and to dates in 2 separate column's in DAX but no luck. and Any one have idea, how to deal with this. ...
Greg_Deckler
Community Champion
6 years agoAnonymous - Well, I would use split in Power Query on the hyphen, that would be easiest, but if you really want a DAX solution:
From = DATEVALUE(MID([Column1],1,FIND("-",[Column1])-1))
To = DATEVALUE(MID([Column1],FIND("-",[Column1])+1,LEN([Column1])))
PBIX is attached below sig, Table 24.
Anonymous
6 years agoNot applicable
Thank you for Helping me.
Unfortunately, it is with BLANK's in Dates Range causing the issue. The BLANK is taken care and now the DAX works well.
Thank you