Forum Discussion
Balanced means
I am working a compairing data for 2 different products in the same table but only for a person that used both products.
To do this I duplicated the table and linked them together. I then use one slicer to pick a product "sand" and a second slicer to pick a product "clay" I than want to get the mean value for the sand over all names who used sand and same thing for clay.
The table from the two slicers looks like this
Here you can see that Jeff has sand listed 3 times and clay listed 2. Jim and John have 1 of each. To get a balanced mean I need to take the mean of Jeff's sand and clay than take the mean of everything.
Is there a way for me to balance the means I thought that AverageX would do this but is seems to not be working?
To make the slicers and mean work I used this code for each table this one for the test table slicer1:
Avg1 = AVERAGEX(FILTER(test,CONTAINS(VALUES('Table2'), Table2[name], test[name])), test[total] )
and this one for table2, slicer 2:
Avg2 = AVERAGEX(FILTER(Table2,CONTAINS(VALUES(test), test[name], Table2[name])), Table2[total] )
In the screenshots below you can see that is gives me a average for clay and sand but this is an average that is not balanced.
My tables are:
2 Replies
- v-yulgu-msftMicrosoft Employee
Hi jeffkrop,
For this requirement, you could have a look at my reply in this thread:
Compare values based on two slicer selections - using only the locations where both selections match
Best regards,
Yuliana Gu
- jeffkropRegular Visitor
I tried that method but I need the average of the two products and after building that to get average it returned numbers that were incorrect. The build I have is returning the correct average if you do not need it to be balanced.