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
Gaucho
Helper I
Helper I

Date

I took a date in a Database with the year 18,19,20,21,22 and
i load it but it came as decimal but when i try to convert these to Date it comes out as 1900.
and i don't know how to get the right date.

Gaucho_0-1673342527859.png

Here is the date but it is in decimal number but when i try to change it to date format it is giving me something else as shown below;

Gaucho_1-1673342580104.png

Thanks in Advance

2 ACCEPTED SOLUTIONS
v-binbinyu-msft
Community Support
Community Support

Hi @Gaucho ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1673404406303.png

 

2. add a new column with below dax formula

Agjust Year =
VAR _val = INT ( "20" & [Year] ) RETURN DATE ( _val, 1, 1 )

 3. set the format in Power BI Desktop

vbinbinyumsft_1-1673404603282.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin 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

It is working. Thank you very much

View solution in original post

3 REPLIES 3
v-binbinyu-msft
Community Support
Community Support

Hi @Gaucho ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1673404406303.png

 

2. add a new column with below dax formula

Agjust Year =
VAR _val = INT ( "20" & [Year] ) RETURN DATE ( _val, 1, 1 )

 3. set the format in Power BI Desktop

vbinbinyumsft_1-1673404603282.png

Please refer the attached .pbix file.

 

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

@v-binbinyu-msft is there a possibility to have the date with the Month included(i.e MM:JJJJ) or in this format (DD:MM:JJJJ). Thanks in advance

It is working. Thank you very much

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.