Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Team,
I have the following measure to get year month (YYYYMM) number for the value selected in the date filter.
Solved! Go to Solution.
Hi @Jos13 ,
We can try to use the following measure to meet your requirement:
Prev Year Month =
VAR CYM =
MIN ( 'Date'[YM no] )
RETURN
CALCULATE (
MAX ( 'Date'[YM no] ),
FILTER (
ALL ( 'Date' ),
'Date'[YM no] < CYM
)
)
Best regards,
Hi @Jos13 ,
We can try to use the following measure to meet your requirement:
Prev Year Month =
VAR CYM =
MIN ( 'Date'[YM no] )
RETURN
CALCULATE (
MAX ( 'Date'[YM no] ),
FILTER (
ALL ( 'Date' ),
'Date'[YM no] < CYM
)
)
Best regards,
If time intelligence functions fail you, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
With date calendar and rime intelligence, you can get that easily. Make sure you move all your month year calc to the calendar table
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
Appreciate your Kudos.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.