The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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:
I have tried DAX formulas with AVERAGEX, but it allows for average aggregation only across single dimension.
Solved! Go to Solution.
I created a dataset
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...
Hope this gets you pointed in the right direction.
Proud to be a Super User! | |
I created a dataset
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...
Hope this gets you pointed in the right direction.
Proud to be a Super User! | |
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
50 | |
46 |