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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Average year over year excluding non-recurring values

Hi,

 

I am having trouble calculating an average measure or column for each year with only recurring values.

In more detail, I want to calculate the average wage for employees in 2019 but only those that worked here in 2018 and vice versa.

 

The following is a fictional and simplified dataset:

 

EmployeeMonth
(dd-mm-yyyy)
Wagecombi
0011-1-2018 €                8.00020180101001
0021-1-2018 €                4.00020180101002
0031-1-2018 €                4.00020180101003
0041-1-2018 €                3.80020180101004
0011-12-2018 €                8.40020181201001
0021-12-2018 €                4.30020181201002
0031-12-2018 €                4.20020181201003
0051-12-2018 €                2.80020181201005
0021-1-2019 €                4.30020190101002
0031-1-2019 €                4.30020190101003
0051-1-2019 €                2.80020190101005
0021-12-2019 €                5.00020191201002
0031-12-2019 €                4.85020191201003
0051-12-2019 €                2.90020191201005
    
Current calculation   
average 2018 €                4.938  
average 2019 €                4.025  
Increase-18%  
    
Desired calculation only includes 002 and 003 
average 2018 €                4.125  
average 2019 €                4.613  
Increase12%  

 

There are many more employeesin the actual dataset.

 

Currently i have three measures:

2018 wage/fte =
CALCULATE(
AVERAGE(table[wage]);
FILTER(ALL('Dim Date');'Dim Date'[CalendarYear] = 2018))
 
2019 wage/fte =
CALCULATE(
AVERAGE(table[wage]);
FILTER(ALL('Dim Date');'Dim Date'[CalendarYear] = 2019))
 
Increase =
[2019 wage/fte] / [2018 wage/fte] -1
 
(I also tried the quick measures, yoy change and rolling average, but couldn't get the to work with any of the date fields.)
Any ideas on how to filter the averages on nondistinct values?
 
 
Thanks
Wouter
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

If you create relationships as below (using "Both" direction)

Capture2.JPG

Then create measures

Min year = CALCULATE(MIN('date'[year]),ALLEXCEPT('Table','Table'[Employee]))

Max year = CALCULATE(MAX('date'[year]),ALLEXCEPT('Table','Table'[Employee]))

average_2018 = CALCULATE(AVERAGE('Table'[Wage]),FILTER(ALL('Table'), YEAR('Table'[Month])=2018&&[Min year]=2018&&[Max year]=2019))

average_2019 = CALCULATE(AVERAGE('Table'[Wage]),FILTER(ALL('Table'), YEAR('Table'[Month])=2019&&[Min year]=2018&&[Max year]=2019))

Capture3.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

If you create relationships as below (using "Both" direction)

Capture2.JPG

Then create measures

Min year = CALCULATE(MIN('date'[year]),ALLEXCEPT('Table','Table'[Employee]))

Max year = CALCULATE(MAX('date'[year]),ALLEXCEPT('Table','Table'[Employee]))

average_2018 = CALCULATE(AVERAGE('Table'[Wage]),FILTER(ALL('Table'), YEAR('Table'[Month])=2018&&[Min year]=2018&&[Max year]=2019))

average_2019 = CALCULATE(AVERAGE('Table'[Wage]),FILTER(ALL('Table'), YEAR('Table'[Month])=2019&&[Min year]=2018&&[Max year]=2019))

Capture3.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you!

Took me a while to see what you did, but as i understand it, [Min year] for instance gives me the first year a employee was in the dataset?

 

Hi @Anonymous 

Yes, if there are more dates in your dataset, but you only want 2018, 2019 years' data, please let me know so that i can modify my solution for you.

 

Best Regards
Maggie

Anonymous
Not applicable

Thanks,

I Managed to change your solution myself a bit, introducing max month as well.

Works fine!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors