Forum Discussion
Anonymous
5 years agoNot applicable
Calculate average instead Total in Matrix subtotals
Hello, The matrix in the screenshot below compares two dates based on the date selection from the left filters. I want to re-create the measure “Labour_Hour_Compare” to calculate the average instea...
- Anonymous5 years ago
Hi Anonymous ,
Try this measure
Labour_Hour_Compare = VAR selected_Date = SELECTEDVALUE ( 'Dates'[Date], MAX ( 'Dates'[Date] ) ) return AVERAGEX(KEEPFILTERS(VALUES('Sample Date'[HourDesc])),CALCULATE ( SUM ( 'Sample Date'[Labour_Hours] ), 'Sample Date'[Date] = selected_Date ) )Reference: https://community.powerbi.com/t5/Desktop/Avg-Subtotal/td-p/636622
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
5 years agoNot applicable
Hi Anonymous ,
Try this measure
Labour_Hour_Compare =
VAR selected_Date =
SELECTEDVALUE ( 'Dates'[Date], MAX ( 'Dates'[Date] ) )
return AVERAGEX(KEEPFILTERS(VALUES('Sample Date'[HourDesc])),CALCULATE ( SUM ( 'Sample Date'[Labour_Hours] ), 'Sample Date'[Date] = selected_Date )
)
Reference: https://community.powerbi.com/t5/Desktop/Avg-Subtotal/td-p/636622
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.