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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.