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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

how to get the last day of the year from date in variable?

Hi, I have a var that contains a date. lets say 15.7.2022 for example. How can I get the last day of the year based on that date?

 

15.7.2022 --> 31.12.2022
3.1.2021 --> 31.12.2021 

 

etc. 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @Anonymous ,

 

How about this one:

DATE ( YEAR ( Table[Date] ), 12, 31 )

 

This one would give you:

15.7.2022 --> 31.12.2022
3.1.2021 --> 31.12.202(instead of 31.12.2022 as you stated in the question above though)

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
tackytechtom
Super User
Super User

Hi @Anonymous ,

 

How about this one:

DATE ( YEAR ( Table[Date] ), 12, 31 )

 

This one would give you:

15.7.2022 --> 31.12.2022
3.1.2021 --> 31.12.202(instead of 31.12.2022 as you stated in the question above though)

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

Thanks, works great 🙂

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors