Forum Discussion
Average By Group
Hello
I am wanting to get a total budget for a business, however i need to average on each nominal ledger description to do this.
How do i average by group in a table like in the image?
so i would want the result for advertising to be -2300.00 and for agency staff to be -20000.00
3 Replies
- amitchandak
Super User
Ivolution93 , Try a measure like
averageX(values(Table[nominal ledger description]), [budgeted allowed value])
Use isinscope if needed
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
- v-henryk-mstf
Community Support
Hi Ivolution93 ,
According to your question, you can create two different measures to get the value of Sum and Average. I did the following test: Sum_Measure is used to display the result of Sum in Matrix, and Avg_Measure is used to display the result of average in Matrix.
Best Regards,
HenryIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- mohammedadnant
Impactful Individual
Hi Ivolution93
Good day, try this
SumAvg Grp =SWITCH(TRUE(),ISINSCOPE(TestTable[Type]), SUM(TestTable[Amount]),AVERAGE(TestTable[Amount]))Thanks & Regards,
Mohammed Adnan