Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
YEAR function generate wrong values:
Solved! Go to Solution.
Hello @waleed111 ,
Based on the sample data, how did you create this [Time Added] column? Basically the Year() function will return the corresponding year of the column value and works well in my environment if the column is using formula or quote directly.
Maybe you can also try using .year to check:
Column 3 = 'Calendar'[Date]. [Year]
In addition, if you use the format() function to get the year value, it will be displayed as the default text type and can only be converted to the sunch number type as integer, decimal number, and so on, the date type is not allowed.
Like this:
Column 4 = CONVERT(FORMAT('Calendar'[Date],"YYYY"),DOUBLE)
Column 4 = CONVERT(FORMAT('Calendar'[Date],"YYYY"),INTEGER)
Best Looks,
Yingjie Li
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
@waleed111 , Was it the date time column having only time added with some days. or was it the duration column. Power does add date to the time column. because of that, you might get that.
Can you share sample data and sample output in table format?
Hello @waleed111 ,
Based on the sample data, how did you create this [Time Added] column? Basically the Year() function will return the corresponding year of the column value and works well in my environment if the column is using formula or quote directly.
Maybe you can also try using .year to check:
Column 3 = 'Calendar'[Date]. [Year]
In addition, if you use the format() function to get the year value, it will be displayed as the default text type and can only be converted to the sunch number type as integer, decimal number, and so on, the date type is not allowed.
Like this:
Column 4 = CONVERT(FORMAT('Calendar'[Date],"YYYY"),DOUBLE)
Column 4 = CONVERT(FORMAT('Calendar'[Date],"YYYY"),INTEGER)
Best Looks,
Yingjie Li
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
It must be Data Type issue in the Add Column . Have you checked the DAta type OR
Try using Format([Date],"YYYY") and let me know whethe you are able to get the Year
Proud to be a Super User!
now FORMAT function work but it show me this error:
Cannot convert value '2020' of type Text to type Date.
Year can be Text . Any Specific purpose you want that to be as number.
For Example if you want to use Year in Filter Context , then you can use "2020" to achieve the target
Hope this clarifies. If you have find this as solution please mark this a ssolution and share your Kudoes
Vijay Perepa
Proud to be a Super User!
Year Function only can handle Dates, you are giving Hours:Minutes as an argument
Proud to be a Super User!
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 23 | |
| 22 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 63 | |
| 44 | |
| 42 | |
| 40 | |
| 40 |