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

First day of current month but in the previous year

Hi,

 

Looking to calculate the first day of the current month but in the previous year in a dax measure. So if ran today it would give me 5/1/2020.

 

Thanks in advanced

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Anonymous 

If you have a 'Date' table and you're wanting to create a date filter, you can write this:

SAMEPERIODLASTYEAR ( STARTOFMONTH ( TREATAS ( { TODAY () }, 'Date'[Date] ) ) )

 If you instead need the date as a scalar, you could write something like this:

EOMONTH ( TODAY(), -13 ) + 1

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

Time intelligence functions and time functions are totoally different,

Screenshot 2021-05-29 140518.png

Screenshot 2021-05-29 140610.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

OwenAuger
Super User
Super User

Hi @Anonymous 

If you have a 'Date' table and you're wanting to create a date filter, you can write this:

SAMEPERIODLASTYEAR ( STARTOFMONTH ( TREATAS ( { TODAY () }, 'Date'[Date] ) ) )

 If you instead need the date as a scalar, you could write something like this:

EOMONTH ( TODAY(), -13 ) + 1

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Anonymous
Not applicable

Thank you! Just what I needed as I needed the date as a scalar. 

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.