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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

oRepeating Values of one Year

Hello DAX professionals,

 

I'm new to DAX and struggling with the following problem: I want to create a measure that repeats the monthly values of a specific year of a given time series in all years after that specific year.

 

For instance, I have a series of consecutive numbers from January 2018 on, and I want to create another measure that repeats only the values of the year 2018 for each month in the consecutive years to come:

 

 capture.png

I found SAMEPERIODLASTYEAR, but that's not exactly what I want.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a measure like this with help from date table and try

 

Year/s behind Sales = CALCULATE(SUM(Table[time series]),dateadd('Date'[Date],2008- max('Date'[year]),Year))

 

or

 

= CALCULATE(SUM(Table[time series]),filter(allselected('Date'),'Date'[year] = 2008 && 'Date'[Month] =max('Date'[Month])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a measure like this with help from date table and try

 

Year/s behind Sales = CALCULATE(SUM(Table[time series]),dateadd('Date'[Date],2008- max('Date'[year]),Year))

 

or

 

= CALCULATE(SUM(Table[time series]),filter(allselected('Date'),'Date'[year] = 2008 && 'Date'[Month] =max('Date'[Month])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Perfect, your first solution worked for me. Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.