Forum Discussion
Matrix visual - add column for average
- 6 years ago
Hi Peavey ,
It means that you could change the default Total value in Matrix visual to any aggregation value you want. For example, change Total to Avg.
Measure = IF ( HASONEFILTER ( 'Table'[Index] ), SUM ( 'Table'[Value] ), AVERAGE ( 'Table'[Value] ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 6 years ago
Hi Peavey ,
Try this:
Measure = IF ( HASONEFILTER ( 'Table'[Index] ), SUM ( 'Table'[Value] ), AVERAGEX ( SUMMARIZE ( 'Table', 'Table'[Asset], 'Table'[Index], "Sum_", SUM ( 'Table'[Value] ) ), [Sum_] ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Peavey , I do not think so. But can change it Avg. Refer, if this can help
https://community.powerbi.com/t5/Desktop/AVG-instead-Total-in-matrix/td-p/327031
Thanks... but I really don't understand what they are doing here?
Are they making a new measure in a column?
/A
- Icey6 years agoCommunity Support
Hi Peavey ,
It means that you could change the default Total value in Matrix visual to any aggregation value you want. For example, change Total to Avg.
Measure = IF ( HASONEFILTER ( 'Table'[Index] ), SUM ( 'Table'[Value] ), AVERAGE ( 'Table'[Value] ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Peavey6 years agoHelper III
Thanks, it works perfectly 🙂
Can you explain the formula for me please?
I don't follow what happens here:
IF ( HASONEFILTER ( 'Table'[Index] ), SUM ( 'Table'[Value] ), AVERAGE ( 'Table'[Value] ) )- Icey6 years agoCommunity Support
Hi Peavey ,
HASONEFILTER returns TRUE when the number of directly filtered values on columnName is one; otherwise returns FALSE. And HASONEVALUE could also be used in your scenario. Here is one post which explains the principle in more detail.
In your scenario, one column is one filtered value. Total column in Matrix visaul contains more than one filtered values. Hope I explained clearly.
Best Regards,
Icey