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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Posie13
Regular Visitor

I need to calculate the Average of a sum by group

Here is my data. I have sales by team and period I want to sum that for every period and then get an average of the sum for all periods by team so my result should look like the final chart.

period saleteam  Period sumAverage period sum  by team   
Period 1350blue       
period 1150bluePeriod 1500     
period 2250blue  550    
period 2350bluePeriod 2600     
Period 150red       
period 140redPeriod 190     
period 2175red  177.5    
period 290redPeriod 2265     
          
    WF13:V18     
          
Final chart        
average sum of sales by period        
TeamAverage sum of sales       
Red177.5        
Blue550        
1 ACCEPTED SOLUTION
MarkLaf
Solution Sage
Solution Sage

I think something like the below should work for you.

Measure = 
AVERAGEX( 
    SUMMARIZE( 'Table', 'Table'[team ], 'Table'[period ] ), 
    CALCULATE( SUM( 'Table'[sale] ) ) 
)

 

MarkLaf_0-1683313476903.png

 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

These measures work

S = SUM(Data[sale])
Measure = AVERAGEX(VALUES(Data[period]),[S])

Hhope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MarkLaf
Solution Sage
Solution Sage

I think something like the below should work for you.

Measure = 
AVERAGEX( 
    SUMMARIZE( 'Table', 'Table'[team ], 'Table'[period ] ), 
    CALCULATE( SUM( 'Table'[sale] ) ) 
)

 

MarkLaf_0-1683313476903.png

 

Thanks so much I will give it a try

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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