Using Teradata SQL, am trying to create columns showing only year (e.g. 2025) or month (e.g. 6) extracted from a datestamp. Currently stored as int
Upon importing to Power BI, it'll reconfigure that year number to something like 01/04/1905.
Is there a way I can have this just import straight into Power BI as a column recognised as a year?
I'm trying to avoid having to manually extract the month, year etc within Power Bi, would rather just do that conversion in SQL have it imported as is. Thanks!
(tried storing 2025 both as int and as varchar, same result when converting to date in power bi)
Using Teradata SQL, am trying to create columns showing only year (e.g. 2025) or month (e.g. 6) extracted from a datestamp. Currently stored as int
Upon importing to Power BI, it'll reconfigure that year number to something like 01/04/1905.
Is there a way I can have this just import straight into Power BI as a column recognised as a year?
I'm trying to avoid having to manually extract the month, year etc within Power Bi, would rather just do that conversion in SQL have it imported as is. Thanks!
(tried storing 2025 both as int and as varchar, same result when converting to date in power bi)
You should be able to use the YEAR and MONTH functions in SQL to create separate columns for year and month, something like this:
SELECT DISTINCT
YEAR(date_column) as YEAR,
MONTH(date_column) as Month
FROM
TABLE
"Currently stored as int"
Well there's your first problem. Fix that (because it really is a broken schema design, and suddenly things get easier. – Joel Coehoorn Commented Jan 21 at 15:46