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 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
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