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
CJ_96601
Helper V
Helper V

Calculated Measure

Need help, 

 

Please see below sample table:  

 

Need to get the average by getting 2021  YE of 50 + data from 2022 based on month selected.

 

Note that 2021 YE must always be the YE total and must not be affected by date filters.

 

2021Jan2     
2021Feb2     
2021Mar2     
2021Apr4     
2021May5     
2021Jun6     
2021Jul7     
2021Aug8     
2021Sep8     
2021Oct2     
2021Nov2     
2021Dec2     
 Total YE50     
        
   Avg Formula - Total YE +  data (based on month selected)
2022Jan226    
2022Feb326.5    
2022Mar427    
2022Apr527.5    
2022May628    
2022Jun728.5    
2022Jul829    

 

Thanks and regards, 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@CJ_96601 , Using a separate date/year table joined to you tbale

 

Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

 

Not you can have

 

Last Year = (CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1)) + sum('Table'[Qty]) )/2

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

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.