Forum Discussion
Use Slicer as a summarizer with Average values
Hi!
I have a graph that has average values in it. These average values I have calculated in a measure. In a slicer I can specify which products I want to see the average values of. But if I use more than one product, it calculates the average value of those 2. But the slicer needs to summarize these values together.
For example:
| Product: | Average value: |
| Cheese | 10 |
| Milk | 10 |
| Eggs | 10 |
What happends in my case is that the average value will stay 10. But I want that it goes to 30. How can I do this?
Hi Anonymous ,
What you need to do is an aggregator measure in this case use the SUMX:
AVERAGE VALUE = IF(HASONEVALUE(Table[Product]); [AVERAGE MEASURE]; SUMX(ALLSELECTED(Table[Products]);[AVERAGE MEASURE])This will make the sum of all averages values when you don't have a single product selected.
6 Replies
- AnonymousNot applicable
Hi Anonymous ,
You can refer to this measure and modify your own measure.
Measure = CALCULATE(SUM('Table'[Value]),ALLSELECTED('Table'))/COUNT('Table'[Product])Result would be shown as below:
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi
the average of your value for Cheese is 10, for Milk is 10 and for Eggs is 10.
If you select only "Cheese", then the table will show only Cheese with an average that won't change as it stays at 10.So I don't understand what you want exactly. Unless you want to show 30 in the total row...?
- amitchandak
Super User
I think you need sum of Avg
https://community.powerbi.com/t5/Desktop/SUM-of-AVERAGE/td-p/197013
- MFelix
Super User
Hi Anonymous ,
What you need to do is an aggregator measure in this case use the SUMX:
AVERAGE VALUE = IF(HASONEVALUE(Table[Product]); [AVERAGE MEASURE]; SUMX(ALLSELECTED(Table[Products]);[AVERAGE MEASURE])This will make the sum of all averages values when you don't have a single product selected.
- AnonymousNot applicable
Is it also possible with this measure that you don't select all product? For example 3, and show for these 3 the average sum value?
- MFelix
Super User
Hi Anonymous ,
This works for any selection of the products doesn't matter how many you choose.
If you select only one it will make the average otherwise will pick up the number of products you select and their respective averages and sum them.