Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
BITomS
Continued Contributor
Continued Contributor

Use Max Date Month From Fact Table in Prior Years in Matrix

Hi all,

This problem is a blocker to a wider calculation (YTD measure), but am just showing this specific part in the hope to make it easier to resolve.

I have a number of years in my matrix table and want to identify the Max Month in the current year (i.e. May 2024 which is showing correctly as 5 below), but also apply this same month to previous years to make it dynamic. However, for the previous years, the YTD month returned is for the full year i.e. 12.

 

Please may someone help me understand how I can ensure 2022 and 2023 years also show 5 instead of 12?

FYI, the max date is taken from a fact table (DailyConsumptions), not a Date dimension table, although a date dimension table does exist in the model.

 

BITomS_0-1718289017572.png

 

1 ACCEPTED SOLUTION
BITomS
Continued Contributor
Continued Contributor

Fixed it myself:

VAR _Month = MONTH(calculate(max(DailyConsumptions[Date]),removefilters('Date')))

View solution in original post

1 REPLY 1
BITomS
Continued Contributor
Continued Contributor

Fixed it myself:

VAR _Month = MONTH(calculate(max(DailyConsumptions[Date]),removefilters('Date')))

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.