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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculate Average of a Measure by Year

I have a measure which is calculates % diff for each month of year across multiple years. Now, I would like to calculate the average of all the months for each year separately and plot both of them in teh same graph. 

 

If you see the data below, the column YOY Avg is a measure and it calculates for each month. Now, I want to calculate the last column Avg which is the avg of all YOY values for 2019. 

 

I am unable to come up with a DAX formula that does that. Here is what i used :

Avg = AVERAGEX(VALUES(TABLE[DATE]),[YOYMeasure])
 
I want to plot the YOY avg and Avg in same graph. 

 

MonthStartDateYOY AvgYearAvg
1/1/2019 0:00-5%20191%
2/1/2019 0:00-8%20191%
3/1/2019 0:002%20191%
4/1/2019 0:0015%20191%
5/1/2019 0:00-3%20191%
6/1/2019 0:00-6%20191%
7/1/2019 0:002%20191%
8/1/2019 0:004%20191%
9/1/2019 0:004%20191%
10/1/2019 0:002%20191%
11/1/2019 0:004%20191%
12/1/2019 0:005%20191%
1/1/2020 0:006%20203%
2/1/2020 0:008%20203%
3/1/2020 0:008%20203%
4/1/2020 0:001%20203%
5/1/2020 0:0018%20203%
6/1/2020 0:000%20203%
7/1/2020 0:00-2%20203%
8/1/2020 0:00-2%20203%
9/1/2020 0:000%20203%
10/1/2020 0:001%20203%
11/1/2020 0:004%20203%
12/1/2020 0:00-1%20203%
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

Try like

Avg = AVERAGEX(allexcept(TABLE,TABLE[Month year]),[YOYMeasure])

or

Avg = AVERAGEX(allexcept(TABLE,TABLE[year]),[YOYMeasure])

 

Avg = AVERAGEX(all(TABLE),[YOYMeasure])

 

Avg = calculate(AVERAGEX(values(TABLE[Date]),[YOYMeasure]),all(Table))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors