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
Anonymous
Not applicable

Calculate the value of a specific past month and set it for all current months

Hi, I'm trying to create a measure that would calculate the value of previous december for all current month. 

So far I managed to get the value of past december 2018 for the current december 2019 month with the following Dax formula : 

CALCULATE(Table[Value];FILTER(ALL(Date);Date[Month_NB]=12);SAMEPERIODLASTYEAR(Date[Date])) 
 
But I would like to get the same December 2018 value in all month starting from January to december 2019. 
Thanks 
 
Capture13.PNG
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try

CALCULATE(Table[KPI Value];FILTER(ALL(Date);Date[Month_NB]=12 && YEAR(Date[Date])=YEAR(SELECTEDVALUE(Date[Date]))-1) ) 

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @Anonymous 

try

CALCULATE(Table[KPI Value];FILTER(ALL(Date);Date[Month_NB]=12 && YEAR(Date[Date])=YEAR(SELECTEDVALUE(Date[Date]))-1) ) 

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thanks it works fine ! 

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.