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
JayproviBI
Regular Visitor

How to combine calculate and EOMONTH Filter

Hello, i have the following Measure

last month = calculate(sum('Table 1'[Revenue]),
'Table 1', eomonth('Table 1'[ReportDate],-1))
or 
last month = calculate(sum('Table 1'[Revenue]),
'Table 1', 'Table 1'[ReportDate] = eomonth('Table 1'[ReportDate],-1))
 
With this measure i want to generate the revenue of the last day of the previous month. I have tried multiple adjustment but it doesnt seem to work. It works with 'Today()' but i want that viewers/users can change the 'reportdate' (with a filter) and that the PBI table will generate information about the last 3 months (on the last day) so i have multiple measures like this last month, 2nd last month, 3th last month. 
Im looking forward to your solutions!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @JayproviBI 
Please try

last month =
CALCULATE (
    SUM ( 'Table 1'[Revenue] ),
    'Table 1'[ReportDate] = EOMONTH ( MAX ( 'Table 1'[ReportDate] ), -1 )
)

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @JayproviBI 
Please try

last month =
CALCULATE (
    SUM ( 'Table 1'[Revenue] ),
    'Table 1'[ReportDate] = EOMONTH ( MAX ( 'Table 1'[ReportDate] ), -1 )
)

Your the man! Thanks, Highly appreciated. It works! 

NikhilChenna
Skilled Sharer
Skilled Sharer

Hi @JayproviBI ,

I think the second meaure could work please try to create the EOM meaure and then use it in your measure.

EOM = eomonth('Table 1'[ReportDate],-1)

 

last month = calculate(sum('Table 1'[Revenue]),
'Table 1''Table 1'[ReportDate] = EOM)
 

Regards, 
Nikhil Chenna 


Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

Thank you for your reaction. Unfortunately i cant create this measure because i cant use directly eomonth and connect to the table. When i use the filter function like '

EOM.lastmonth = filter('table 1', eomonth('table 1'[ReportDate],-1))'

and use it on my primary measure i get an error message

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.