Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Data Shaping

Hello!

 

I am working with an example database that in the fact table has a date column with years 1900, 1901 and 1902. How can I change the years of this date column to other years (for example 2005,2006 and 2007) in the Query Editor, maintaining the day and the month?

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

This is my test table:

vyadongfmsft_0-1661335513580.png

 

Please change data type from “Date” to “Text”.

vyadongfmsft_1-1661335513585.png

 

Select Transform tab – Replace Values, enter the value you want to find and replace with.

vyadongfmsft_2-1661335513587.png

 

Then you can change the year and maintain the day and the month.

vyadongfmsft_3-1661335513588.png

 

Last, please remember to change data type from text to date.

vyadongfmsft_4-1661335513590.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

This is my test table:

vyadongfmsft_0-1661335513580.png

 

Please change data type from “Date” to “Text”.

vyadongfmsft_1-1661335513585.png

 

Select Transform tab – Replace Values, enter the value you want to find and replace with.

vyadongfmsft_2-1661335513587.png

 

Then you can change the year and maintain the day and the month.

vyadongfmsft_3-1661335513588.png

 

Last, please remember to change data type from text to date.

vyadongfmsft_4-1661335513590.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you very much for the detailed solution.

amitchandak
Super User
Super User

@Anonymous , In power query you can use

 

Date.AddYears([Date], 205)

 

Use on new column of transform the same column

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.