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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors