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
Anonymous
Not applicable

Date Filtering on a Measure Not Working

I have one table that has 'snapshot date', 'report name', and 'automated'. I'm trying to retreive those from the most recent month that are automated. Automated is a binary column that reports 1 if the report is automated. Here are the sample PBIX where I'm working on the issue and the data.

When I try the following, it does not sum for the most recent month, but for the whole dataset. 

current month sum of automated reports =
CALCULATE (
    SUM ( 'Automated Report Record'[Automated] ),
    FILTER (
        'Automated Report Record',
        AND (
            MONTH ( 'Automated Report Record'[Snapshot Date] ) = [Latest Month],
            YEAR ( 'Automated Report Record'[Snapshot Date] ) = [Latest Year]
        )
    )
)

 

When I hard code the measures of Latest Month and Latest Year, it works as expected returning 6, but with the measures as the value, it doesn't work. 

Latest Month and Latest Year defined as the following:

Latest Month = MONTH(LASTDATE('Automated Report Record'[Snapshot Date])) 

Latest Year = YEAR(LASTDATE('Automated Report Record'[Snapshot Date]))


I've found the following post, but the solutions haven't solved my problem. 

 

Please help me understand what I'm missing here.

Thanks,

Chris

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Could you please help me understand what the issue was in my code block as well? 


Best, 


Chris

I built a Calendar Table to simplify your formulas.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

Top Solution Authors