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
Arthur_NS
Helper I
Helper I

Average of sums

Hello,

 

With the example below, I'm trying to show in a graph the sum of country averaged per sector

 

Arthur_NS_1-1629820569200.png

 

What I'm trying to get at is for example for Sector A:

France = 1000+6000=7000

Germany=2000

Average=4500

 

A straight average would give me 3000 (average of 1000, 6000 and 2000).

Any idea to calculate this and show it on a graph for each sector?

Thank you,

Arthur

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Arthur_NS , see if a measure like this can help

 

averageX(values(Table[country]), calculate(sum(Table[sales])))

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Arthur_NS This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Arthur_NS , see if a measure like this can help

 

averageX(values(Table[country]), calculate(sum(Table[sales])))

Sorry but that's not working, it gives me a simple sum of Sales.
Also the Sector variable is not taken into account

My bad it's actually working, thanks a lot!

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.