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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mammifero
Frequent Visitor

date conversion from text

Good Morning to everyone from Italy

apologize for my bad English

 

i ask for a help or a suggestion.

at the end of every month i export from my datawarehouse to Excel two tables with sales information that i use to create reports for my CEO.

Now i'm starting to use PowerBI but and i'm a little bit in trouble with the concept of DATE 

 

i would like to create a calendar table but here's my problem:

the colum Year and Month are text formatted.

Immagine.jpg

how i can convert to date format ?

is possible ?

 

Thanks

 

 

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

@mammifero

 

You can add a New Column for example

 

Column =
DATE ( VALUE ( [Year] ), VALUE ( [MonthNumber] ), 1 )

Regards
Zubair

Please try my custom visuals

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

Write this calculated column formula

 

=1*("1/"&[MonthNumber]&"/"&[Year])

 

Format this column as Date.


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Write this calculated column formula

 

=1*("1/"&[MonthNumber]&"/"&[Year])

 

Format this column as Date.


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

thanks to all of you for your kindly answers, both working.

 

last question, if i create a new table "Calendar" with the function "CALENDARAUTO ()" I obtain an error

message "the function is not able to find a base column DateTime in the model"

 

i dont understand well why i obtain this error

 

Regard from Italy

 

Matteo

Zubair_Muhammad
Community Champion
Community Champion

@mammifero

 

You can add a New Column for example

 

Column =
DATE ( VALUE ( [Year] ), VALUE ( [MonthNumber] ), 1 )

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.