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
This is driving me mad. I want to be able to use a seperate metric for the most recent month. I've got the below calculation and it's working for the most recent period but not for the previous one.
Measure =
VAR MaxMonth = CALCULATE(MAX('Calendar'[FISCAL_PERIOD]), 'OPS_BONUS MANUAL_TECHNICIAN_IO_VW'[BONUS_PAYMENT] > 0)
VAR BonusCurrent = sum('OPS_BONUS MANUAL_TECHNICIAN_IO_VW'[BONUS_PAYMENT])
VAR BonusPrevious = SUM('OPS_BONUS MANUAL_TECHNICIAN_VIEW_TECH_OPTI_WEEKLY_SNAPSHOT_VW'[Column])
RETURN
IF(VALUES('Calendar'[FISCAL_PERIOD]) = MaxMonth, BonusCurrent, BonusPrevious)
Try this measure:
Bonus Measure =
VAR MaxMonth =
CALCULATE (
MAX ( 'Calendar'[FISCAL_PERIOD] ),
ALL ( 'Calendar' ),
'OPS_BONUS MANUAL_TECHNICIAN_IO_VW'[BONUS_PAYMENT] > 0,
CROSSFILTER ( 'Calendar'[Date], 'OPS_BONUS MANUAL_TECHNICIAN_IO_VW'[Date], BOTH )
)
VAR BonusCurrent =
SUM ( 'OPS_BONUS MANUAL_TECHNICIAN_IO_VW'[BONUS_PAYMENT] )
VAR BonusPrevious =
SUM ( 'OPS_BONUS MANUAL_TECHNICIAN_VIEW_TECH_OPTI_WEEKLY_SNAPSHOT_VW'[Column] )
RETURN
IF ( MAX ( 'Calendar'[FISCAL_PERIOD] ) = MaxMonth, BonusCurrent, BonusPrevious )
I'm assuming that you have a "1:*" unidirectional relationship between Calendar and each fact table using the Date column. The CROSSFILTER function allows you to filter from the fact table to the Calendar table. The ALL function clears the Calendar filter context in the visual. Also, in the final line I changed VALUES to MAX. VALUES returns a table, and you can't compare a table to a scalar.
Proud to be a Super User!
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!