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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MileBI
New Member

AverageX function not calculating per row In PowerBI

New user here!
test = 
AVERAGEX('Weekly Report','Weekly Report'[Days In-Office/Travel]+'Weekly Report'[Holidays in selected period]+'Weekly Report'[Days with Time Away])
 
I am trying to get average of 3 columns by row.
My understanding was the x function(averagex, sumx, countx) were used to provided calculation by row and not for the whole column data.
Though this providing a total average instead of individual average
 
PowerBi.PNG


2 ACCEPTED SOLUTIONS
Daniel29195
Super User
Super User

@MileBI 

if you want to sum the 3 columns and divide by 3 

you just need to use the following : 

 

('Weekly Report'[Days In-Office/Travel]+'Weekly Report'[Holidays in selected period]+'Weekly Report'[Days with Time Away] ) / 3 

 

 

if not , then please share how you want to average to be calculated. 

 

 

if this helps kindly mark as an accepted solution as this wjll help others to find the answer easily. 

 

View solution in original post

Ritaf1983
Super User
Super User

Hi @MileBI 
Averagex is an iterating function, so when you use it as a calculated column it iterates the calculation by column level.
If you need just an average between  3 columns just use a simple :

average = divide(
    ([a]+[b]+[c]),3)
Ritaf1983_0-1707499114773.png

more details about how iteration functions work are here :
https://www.youtube.com/watch?v=-3snD-VOqik

it is about sumx, but all of those functions work with the same logic 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

4 REPLIES 4
Ritaf1983
Super User
Super User

Hi @MileBI 
Averagex is an iterating function, so when you use it as a calculated column it iterates the calculation by column level.
If you need just an average between  3 columns just use a simple :

average = divide(
    ([a]+[b]+[c]),3)
Ritaf1983_0-1707499114773.png

more details about how iteration functions work are here :
https://www.youtube.com/watch?v=-3snD-VOqik

it is about sumx, but all of those functions work with the same logic 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks, I guess I was trying to make it more complicated then is needs.
This option works

Daniel29195
Super User
Super User

@MileBI 

if you want to sum the 3 columns and divide by 3 

you just need to use the following : 

 

('Weekly Report'[Days In-Office/Travel]+'Weekly Report'[Holidays in selected period]+'Weekly Report'[Days with Time Away] ) / 3 

 

 

if not , then please share how you want to average to be calculated. 

 

 

if this helps kindly mark as an accepted solution as this wjll help others to find the answer easily. 

 

Thanks, I guess I was trying to make it more complicated then is needs.
This option works

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!

December 2024

A Year in Review - December 2024

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