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

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

Reply
mp390988
Post Patron
Post Patron

Convert text to date

Hi,

 

I have the following table which is storing the TDMonth column as text.

 

mp390988_0-1756456032804.png

 

I am trying to plot a line chart with this column being the x-axis but it's not liking it as it complaining with the following error:

 

mp390988_1-1756456158427.png

 

What is the resolution for this please?

 

Thank You

 

1 ACCEPTED SOLUTION
MohamedFowzan1
Solution Specialist
Solution Specialist

Hi @mp390988 

 

If adding the column within Powerquery:

Date.FromText("01-" & [TDMonth])


Within DAX Calculated column, keep in mind that it depends on the regional date format settings. If thats okay use this:

DateColumn =
DATEVALUE(
"01 " & 'Table'[YourColumn]
)


 else:

DateColumn = 
DATE(
    RIGHT('Table'[TDMonth],4),
    SWITCH(
        LEFT('Table'[TDMonth],3),
        "Jan",1,"Feb",2,"Mar",3,"Apr",4,"May",5,
        "Jun",6,"Jul",7,"Aug",8,"Sep",9,"Oct",10,"Nov",11,"Dec",12
    ),
    1
)

View solution in original post

7 REPLIES 7
v-aatheeque
Community Support
Community Support

Hi @mp390988 

We’d like to check if you were able to go through the previous response to your issue. Please let us know if you need further clarification we’ll do our best to support you.

Hi @mp390988 

We haven’t heard from you on the last response and was just checking back to see if your query was answered, Otherwise, will respond back with the more details and we will try to help.

Hi @mp390988 
Just checking in to see if you had a chance to review the previous response. If you still need assistance, please let us know and we’ll be glad to help.

Ashish_Mathur
Super User
Super User

Hi,

In Power Query, chaage the data type of that column in the original dat table to Date.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MohamedFowzan1
Solution Specialist
Solution Specialist

Hi @mp390988 

 

If adding the column within Powerquery:

Date.FromText("01-" & [TDMonth])


Within DAX Calculated column, keep in mind that it depends on the regional date format settings. If thats okay use this:

DateColumn =
DATEVALUE(
"01 " & 'Table'[YourColumn]
)


 else:

DateColumn = 
DATE(
    RIGHT('Table'[TDMonth],4),
    SWITCH(
        LEFT('Table'[TDMonth],3),
        "Jan",1,"Feb",2,"Mar",3,"Apr",4,"May",5,
        "Jun",6,"Jul",7,"Aug",8,"Sep",9,"Oct",10,"Nov",11,"Dec",12
    ),
    1
)
Shahid12523
Community Champion
Community Champion

Convert TDMonth from text to date using this DAX:
TDMonthDate = DATEVALUE("01-" & [TDMonth])


Then use TDMonthDate on your x-axis. Set axis type to Continuous for proper time scaling. That’ll fix the error and make your line chart work smoothly

Shahed Shaikh
AnkitaaMishra
Super User
Super User

Hi @mp390988 , create a calculated column with below DAX and change the data type to DATE :

AnkitaaMishra_0-1756457713908.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.