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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Averages in subtotals/totals instead of sum

Hi Experts

 

I've been struggling with the following problem. I have a pivot table where I calculate sum of FTE for employees with months in columns and department/employee_id in rows. Instead of sums in subtotals and totals, I want to see the averages. That's what I have right now in PBI - default aggregation with sum:

BlueWhite111_0-1669929101554.png

 


This is my desired result. I want average aggregation for subtotals/totals across both rows and columns, while keeping sum aggregation of FTE for each employee:

BlueWhite111_1-1669929101560.png

 

I have tried DAX formulas with AVERAGEX, but it allows for average aggregation only across single dimension.

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

I created a dataset

jgeddes_0-1669931731019.png

Wrote the following measure...

Measure = 
var _vTable =
SUMMARIZE(
    emptable,
    emptable[Employee],
    emptable[Date].[Year],
    emptable[Date].[Month],
    "_val", SUM(emptable[Value])
)
var _result =
AVERAGEX(_vTable, [_val])
Return
_result

Where you create a summary table by employee and date and then take the averages of that table.

(It will depend on how your dates are set up. If you had a combined Year/Month column you should only have to add that column to summarize by.)

The result...

jgeddes_1-1669931795284.png

 

Hope this gets you pointed in the right direction.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
jgeddes
Super User
Super User

I created a dataset

jgeddes_0-1669931731019.png

Wrote the following measure...

Measure = 
var _vTable =
SUMMARIZE(
    emptable,
    emptable[Employee],
    emptable[Date].[Year],
    emptable[Date].[Month],
    "_val", SUM(emptable[Value])
)
var _result =
AVERAGEX(_vTable, [_val])
Return
_result

Where you create a summary table by employee and date and then take the averages of that table.

(It will depend on how your dates are set up. If you had a combined Year/Month column you should only have to add that column to summarize by.)

The result...

jgeddes_1-1669931795284.png

 

Hope this gets you pointed in the right direction.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.