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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Getting a yearly average from a measure

I have a ratio measure, and would like to take the yearly average of that measure.

Here is a screenshot of what I would like to achieve for the new average measure, Measure 2:

mathiasljy_0-1596598911449.png

Measure 1 is calculated from 2 columns in my dataset, using DAX: Measure 1 = DIVIDE(Table1[Column1],Table1[Column2],0)
I have tried using this formula for Measure 2: 

Measure 2 = AVERAGEX(SUMMARIZE(Table1,Calendar[Year],"Average",[Measure1]),[Measure1])
But the result i get is exactly the same as Measure 1. Not sure what I'm doing wrong, am quite new to this. 

Thank you for the help!
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous ,

 

Measure 2 = calculate(AvergaeX(Table[Measure1]), filter(allselected(Table),Table[Year]=max(Table[Year])))

or
Measure 2 = calculate(AvergaeX(Table[Measure1]), filter(all(Table),Table[Year]=max(Table[Year])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,
According to my understanding ,you want to calculate average based on measure and different year,right?
I did it in two ways.
 

1.Use Average

Divide column =
DIVIDE ( 'average table'[column1], 'average table'[Column2], 0 )
average measure =
CALCULATE (
    AVERAGE ( 'average table'[Divide column] ),
    ALLEXCEPT ( 'average table', 'average table'[Year] )
)

2.Use Averagex

 

Measure 7 =
SUM ( 'average table'[Divide column] )
use avaragex =
AVERAGEX ( ALLEXCEPT ( 'average table', 'average table'[Year] ), [Measure 7] )

 


My visualization looks like this:

 

8.PNG

Could my methods help you solve the problem? Hope to give me a reply,thanks.
 
Best Regards,
Eyelyn Qin

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,
According to my understanding ,you want to calculate average based on measure and different year,right?
I did it in two ways.
 

1.Use Average

Divide column =
DIVIDE ( 'average table'[column1], 'average table'[Column2], 0 )
average measure =
CALCULATE (
    AVERAGE ( 'average table'[Divide column] ),
    ALLEXCEPT ( 'average table', 'average table'[Year] )
)

2.Use Averagex

 

Measure 7 =
SUM ( 'average table'[Divide column] )
use avaragex =
AVERAGEX ( ALLEXCEPT ( 'average table', 'average table'[Year] ), [Measure 7] )

 


My visualization looks like this:

 

8.PNG

Could my methods help you solve the problem? Hope to give me a reply,thanks.
 
Best Regards,
Eyelyn Qin
amitchandak
Super User
Super User

@Anonymous ,

 

Measure 2 = calculate(AvergaeX(Table[Measure1]), filter(allselected(Table),Table[Year]=max(Table[Year])))

or
Measure 2 = calculate(AvergaeX(Table[Measure1]), filter(all(Table),Table[Year]=max(Table[Year])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

@amitchandak , I used your formula and changed the averagex part to this:

AVERAGEX(SUMMARIZE('Calendar','Calendar'[Date],"Avg",[Measure1]),[Avg])
and then it worked, thanks!
Anonymous
Not applicable

Hi @amitchandak ,

I cant seem to use that formula. After AverageX, Table[Measure1] does not seem to be an option for the first arguement, only Table is available in the drop down list.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.