Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to Solution.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 81 | |
| 69 | |
| 50 | |
| 46 |