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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
hemingt
Helper V
Helper V

How to get the last two digits of the current year

Hi Team,

 

I use the M language  Date.WeekOfYear(Date.From(DateTime.LocalNow()), Day.Monday) to get to the current week number, the value is 14 for today. But I want to get as 1914, is it possible?

if no, I think I can get the last two digits of the year, such as 2019, to get 19,  do you know how to do with M language?

Thank you!

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@hemingt  Please try this as a Custom Column in Power Query to get the last two digits of the current year or any date field from the table.

 

=Text.End(Date.ToText(DateTime.Date(DateTime.LocalNow())),2)

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

2 REPLIES 2
PattemManohar
Community Champion
Community Champion

@hemingt  Please try this as a Custom Column in Power Query to get the last two digits of the current year or any date field from the table.

 

=Text.End(Date.ToText(DateTime.Date(DateTime.LocalNow())),2)

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Thank you @PattemManohar 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors