Forum Discussion
average by group
- 6 years ago
Hola!
Try this...
=AVERAGEX( FILTER( Table1, Table1[Year] = EARLIER(Table1[Year]) ), Table1[Plan Sales Amount] ) - 6 years ago
is it some running average? it looks like you have an error in Excel
if you need average from all groups by year try a measure
Average Plan Sales Amout by Group (Year) = CALCULATE(AVERAGE(Table[Plan Sales Amount]), ALLEXCEPT(Table, Table[Year]) )or column from littlemojopuppy solution
- Anonymous6 years ago
Average by group can be done in ways in DAX, like this above answers. However, I think the data you provided is not correct for some reason. How can you get different values when you average. Maybe check your excel files and also provide the formula you used so we can see what are you calculating to get that expected result.
Usually, you get average by group(year) with column or measures using:
RESULT = CALCULATE(AVERAGE([Plan Sales Amount]), ALLEXCEPT(Table,[Year]))
Best regards
Paul Zheng
Average by group can be done in ways in DAX, like this above answers. However, I think the data you provided is not correct for some reason. How can you get different values when you average. Maybe check your excel files and also provide the formula you used so we can see what are you calculating to get that expected result.
Usually, you get average by group(year) with column or measures using:
RESULT = CALCULATE(AVERAGE([Plan Sales Amount]), ALLEXCEPT(Table,[Year]))
Best regards
Paul Zheng
- yukon6 years agoHelper I
az38 ; littlemojopuppy ; amitchandak ; Anonymous
You all provide the AVG formula is corrrect. Excel file formula is wrong after i checked with the person who give me the file.
Thank you so much for sharing the formula. I have learn a lot from you all.