This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
I have a simple question:
I have a table with a column called Value, which is a string type. Some rows have a string DateTime, such as yyyy/MM/dd, but others have numbers or even alphanumeric codes.
I need to get a new column, converting the DateTimes and setting nulls for the rest of the rows.
It's that possible?
I appreciate your help.
Thanks,
Rodrigo Mocca
Solved! Go to Solution.
Yes. Power Query is the best place to do this. Often the Date.FromText() function can handle a number of text formats.
Those are a few. If you add a new column in Power Query and use this, you will either get a date or a null.
= try Date.FromText([Your Text Date Field]) otherwise null
If you can post some sample data, we can help with formats that Power Query does't natively recognize.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingYes. Power Query is the best place to do this. Often the Date.FromText() function can handle a number of text formats.
Those are a few. If you add a new column in Power Query and use this, you will either get a date or a null.
= try Date.FromText([Your Text Date Field]) otherwise null
If you can post some sample data, we can help with formats that Power Query does't natively recognize.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi,
Thanks for your help. I'll try this now.
Thanks again
@rmocca , check for alphanumerics
use test function to get date
https://docs.microsoft.com/en-us/powerquery-m/text-functions
Thanks for the information.
I'll take a look ASAP.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 31 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 56 | |
| 31 | |
| 26 | |
| 23 |