Forum Discussion
YEAR function
- 5 years ago
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 LiIf this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
ā
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.