Forum Discussion
Calculate Average per category
- 8 years ago
Hi mschultens,
Did you use the original expression in the calculated column? It works for me. Please refer:
Or you can try measure:
AverageMeasure = CALCULATE ( AVERAGE ( Table3[Value] ), FILTER ( ALLSELECTED ( Table3 ), Table3[Category] = MAX ( Table3[Category] ) ) )Thanks,
Xi Jin.
It gives me an error saying that a single value for category cannot be determined. I tried putting a MAX() in front, but that gives the same error.
- v-xjiin-msft8 years agoSolution Sage
Hi mschultens,
Did you use the original expression in the calculated column? It works for me. Please refer:
Or you can try measure:
AverageMeasure = CALCULATE ( AVERAGE ( Table3[Value] ), FILTER ( ALLSELECTED ( Table3 ), Table3[Category] = MAX ( Table3[Category] ) ) )Thanks,
Xi Jin.- jochendecraene4 years agoHelper V
Hi
I'd like to use this solution, but I also have a subcategory and year that I have to take into account.
I tried using extra filters for subcategory and year, but keep getting errors.
Can someone help me?
This is what my table looks like
- sabinozen3 years agoFrequent Visitor
I'm also intrested in this. Did you solved it?
- mschultens8 years agoNew Member
I had a mistake somewhere else in my model. Both solutions work fine! Thank you very much guys! :-)
- Anonymous5 years agoNot applicable
I have a question about average too
I have this data, what I want to achieve :
> Average Total : points PR+WAR from all technician
> Average PR & WAR : point only for PR OR only WAR based on FILTER
This is my code but gave me value :
YESTERDAY
> Average Total : correct value 7,5 this DAX gave me 3,75 (WRONG)
> Average PR & WAR : correct value PR = 3 and WAR = 4.5 this DAX gave me PR = 3 and WAR = 4.5 (CORRECT)
Bassicly how to make this DAX give a correct value for Average Total and Average PR & WAR
1. AVG_Points = AVERAGE(CL_PROD[Points]) 2 AVG_Points_Filter = IF(MAX(CL_PROD[WO_Type])= "PR" || MAX(CL_PROD[WO_Type])= "WAR", [AVG_Points],[AVG_Points]*2)