Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ivolution93
Frequent Visitor

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

AverageOfNomDesc.JPG

3 REPLIES 3
mohammedadnant
Impactful Individual
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
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18
v-henryk-mstf
Community Support
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.

v-henryk-mstf_3-1608805038632.png

 

Here is the sample pbix file.

 

Best Regards,
Henry

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
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/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.