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
waleed111
Helper V
Helper V

YEAR and MONTH function

i write this formula:

Year A = YEAR('All Manufacturings (4)'[Added Time])
but when i try to covert it to date type it show wrong value, it show me 1900 for all value, what is the problem?
1 ACCEPTED SOLUTION

Hi, @waleed111 

I can reproduce your issue here.

79.png

78.png

I guess that you column "Year A" is of type "DATE".

As mentioned in this document ,function "Year"  returns the year of a date as a four digit integer in the range 1900-9999.

It is suggest to convert your column  "Year A" to type "text"  

 

Best Regards,
Community Support Team _ Eason

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@waleed111 , it may be because it is time or has data type as time.

 

Only time will have a year 1900

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

date4.PNG

 It is of type date.

@waleed111 , this is strange, Can you share sample  pbix after removing sensitive data.

 

Try this

Year A = format('[Added Time],"YYYY")

 

Hope you do not have another table. Try without a table name

Year A = YEAR('[Added Time])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

when i use:

Year A = format('[Added Time],"YYYY")

it show me this error: cannot convert value to date.

Hi, @waleed111 

I can reproduce your issue here.

79.png

78.png

I guess that you column "Year A" is of type "DATE".

As mentioned in this document ,function "Year"  returns the year of a date as a four digit integer in the range 1900-9999.

It is suggest to convert your column  "Year A" to type "text"  

 

Best Regards,
Community Support Team _ Eason

FuadAliyev
Frequent Visitor

Hi @waleed111 can you show your AddedTime column data?

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.