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! Request now

Reply
NChamroo
Regular Visitor

Calculating SUM for the previous last month

Hello Experts, 

I have a data set, the actuals and forecast value are in the same column and I am trying to get the Sum of Actuals by month and YTD for the previous months. I need to exclude the current month and the remaining year months. My below formula is returning the total instead of the monthly when I am adding the measure in a matrix. 

Actual BHR (UC) =
CALCULATE(
    SUM('Actual_Forecast[Block Hour]'[Block Hours]),
    FILTER(
        ALL('Calendar Date'[Date].[Date]),
        'Calendar Date'[Date].[Date] < EOMONTH(TODAY(), -1) &&
        'Calendar Date'[Date].[Date] >= DATE(YEAR(TODAY()), 1, 1)
    )
)
NChamroo_0-1717655668789.png

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@NChamroo  It looks like syntax error can you try with below mentioned DAX once

 

Actual BHR (UC) = CALCULATE(
SUM('Actual_Forecast'[Block Hours]),
FILTER(
ALL('Calendar Date'[Date].[Date]),
'Calendar Date'[Date].[Date] < EOMONTH(TODAY(), -1) &&
'Calendar Date'[Date].[Date] >= DATE(YEAR(TODAY()), 1, 1)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
bhanu_gautam
Super User
Super User

@NChamroo  It looks like syntax error can you try with below mentioned DAX once

 

Actual BHR (UC) = CALCULATE(
SUM('Actual_Forecast'[Block Hours]),
FILTER(
ALL('Calendar Date'[Date].[Date]),
'Calendar Date'[Date].[Date] < EOMONTH(TODAY(), -1) &&
'Calendar Date'[Date].[Date] >= DATE(YEAR(TODAY()), 1, 1)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks Gautam, thats perfect

@NChamroo Please accept this as solution if it helped you

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.