Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I have a column in Power Query that has a several years period as a Whole Number, I want to transfer it to a date column
Solved! Go to Solution.
Hi @Sheref_Morad ,
First, change the data type of Year Column to Text.
And now , again change the data type to Date, it'll work.
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Year", type text}}),
#"Changed Type2" = Table.TransformColumnTypes(#"Changed Type1",{{"Year", type date}})
Hi @Sheref_Morad ,
First, change the data type of Year Column to Text.
And now , again change the data type to Date, it'll work.
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Year", type text}}),
#"Changed Type2" = Table.TransformColumnTypes(#"Changed Type1",{{"Year", type date}})
Just click on 123 with the year and convert the type to date
Thanks for Answering, I did that several times and it transformed into irrelevant dates, I just want the number 2015 to be treated as year date
Step 1: Convert to date normally, power query code as below:
= Table.TransformColumnTypes(Table,{{"Year", type date}})
Step 2: From Transform --> Date & Time Column --> Select Date -- Year as shown below:
Code as below:
= Table.TransformColumns(#"Changed Type",{{"Year", Date.Year, Int64.Type}})
However it will convert the year as Whole number only as this is Power BI interprets the year but it should not hamper any of your reporting and calculations
Thank you for Answering , it converted into irrelvant Date so i can't make the year data that was given in the source data
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 43 | |
| 38 | |
| 35 | |
| 21 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 58 | |
| 28 | |
| 27 | |
| 25 |