Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
anis_keyna
Frequent Visitor

Issues to convert data type text to date

Hi all,

 

Currently, I'm facing issues in converting data type to date. The data sources are from sql which have varchar data type. As for now, I could not change data type in date from sql. Therefore, I need to find solution to convert data type to directly from power BI. But could not execute as well. This data is use for generate value for my colum field "status". Below are the screenshort for my issues in which currently the data type are in text. 

 

issues.PNG

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @anis_keyna,

 

From the error message, the STATUS is a measure instead of calculated column, right? 

 

You need to use aggregate function in the measure eg: MAX() 

 

STATUS=IF(MAX('Shipment Planning'[ACT_MVT_DATE])<>BLANK(),"3",
IF(MAX('Shipment Planning'[CONT_NO])<>BLANK(),"2",
IF(MAX('Shipment Planning'[CONT_NO])=BLANK(),"1")))

 

If you create a calculated column, then it's fine to use your own DAX. Please refer to this blog:https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

In Power BI desktop, to convert TEXT date value to DATE type, you can select the date column, then click below option: 

q1.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @anis_keyna,

 

From the error message, the STATUS is a measure instead of calculated column, right? 

 

You need to use aggregate function in the measure eg: MAX() 

 

STATUS=IF(MAX('Shipment Planning'[ACT_MVT_DATE])<>BLANK(),"3",
IF(MAX('Shipment Planning'[CONT_NO])<>BLANK(),"2",
IF(MAX('Shipment Planning'[CONT_NO])=BLANK(),"1")))

 

If you create a calculated column, then it's fine to use your own DAX. Please refer to this blog:https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

In Power BI desktop, to convert TEXT date value to DATE type, you can select the date column, then click below option: 

q1.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks ! Its working now

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.