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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.