Forum Discussion
Matrix Help. Avg instead of Total
- 5 years ago
Hi dmoggie ,
Try the following formula:
Measure = IF( HASONEVALUE('Table'[Date]), MAX('Table'[Value]), AVERAGE('Table'[Value]) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi dmoggie ,
Try the following formula:
Measure =
IF(
HASONEVALUE('Table'[Date]),
MAX('Table'[Value]),
AVERAGE('Table'[Value])
)If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dmoggie5 years agoHelper I
Hi Winniz,
Thank you for your time.
This is closer to what I am trying to acheive, although not quite correct. The values in the matrix are max values and the total now displays avg values, but not the avg of the data contained within the matrix.
For example at 11:00:00 I would expect the avg to be 75.63.
I have a seperate calendar table and for the above page I filter by day of week, could this be causing an issue? When amending your code I seems to always get the highest value in the totals row.
Again any further help would be greatly appreciated.
- v-kkf-msft5 years agoCommunity Support
Hi dmoggie ,
Try the following formula:
Measure = var tab = FILTER( 'Table', 'Table'[Date] in ALLSELECTED('Calendar'[Date]) ) return IF( HASONEVALUE('Table'[Date]), MAXX(tab,'Table'[Value]), AVERAGEX(tab,'Table'[Value]) )This is my PBIX file.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dmoggie5 years agoHelper I
Good Afternoon Winniz,
Thank you so much for your help. Happy to confirm this is just what I required to progress my report.