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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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