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
queryuser
Helper I
Helper I

Calculate if today is not the end of the Current Month, then SUM Year to Previous Month End

Hi,

 

I am struggling to calculate the SUM Year to Previous Month End if today is not the end of Current Month. Maybe you can help.

 

Many thanks,

 

queryuser_1-1639146008197.png

 

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

This dax should do what you are looking for:

IF EOMONTH calculation =
IF(TODAY()<>EOMONTH(TODAY(),0),
CALCULATE(sum('RT12'[Value]),DATESYTD(DATEADD('Calendar'[Date],-1,MONTH))),
CALCULATE(sum('RT12'[Value]),DATESYTD('Calendar'[Date])))
I hope this helps and if it does consider accepting this as a solution!




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

This dax should do what you are looking for:

IF EOMONTH calculation =
IF(TODAY()<>EOMONTH(TODAY(),0),
CALCULATE(sum('RT12'[Value]),DATESYTD(DATEADD('Calendar'[Date],-1,MONTH))),
CALCULATE(sum('RT12'[Value]),DATESYTD('Calendar'[Date])))
I hope this helps and if it does consider accepting this as a solution!




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

Proud to be a Super User!




Hi ValtteriN,

 

Thanks for the quick reply, it worked. Have a great Friday ahead!

 

Best regards,

queryuser

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.