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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
JohnSalt
Helper I
Helper I

YTD figure not working with month name in matrix

Hi

I have a measure for year to date cost variance: 
YTD Variance = CALCULATE ( [Variance], ALL(PERIODS[MonthName]), All(PERIODS[PD_PERIOD]), PERIODS[PD_PERIOD]<= MAX(PERIODS[PD_PERIOD]))
This works fine with a matrix where I have period in the columns, period being the finanical month number starting at 1 for April in UK.

I have a calculated column for month name in the same table which is just calculated from the period number:
MonthName = FORMAT(DATE(1, IF([PD_PERIOD]<9,PERIODS[PD_PERIOD]+3,PERIODS[PD_PERIOD]-9), 1), "MMM")
and as soon as I switch from period to month name in the matrix columns it stops giving a rolling total and gives an in month figure despite me adding in the "All(PERIODS[MonthName])" to the calculate filter?

 

Any ideas?

1 REPLY 1
lbendlin
Super User
Super User

Your data model needs a proper calendar table, marked as such. If your fact table doesn't have dates you need to add a fake date column (for example first day of the month).  Don't try to do time intelligence without a calendar table.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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