Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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.
Thanks
@Anonymous - 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.
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
@Anonymous
Add two columns: Change the data type to Date once you have added the columns.
Date1 =
LEFT('Table'[String],SEARCH("-",'Table'[String])-1)Date2 =
RIGHT('Table'[String],SEARCH("-",'Table'[String])-1)
________________________
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 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 10 | |
| 9 |