cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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 sale team Period sum Average period sum  by team Period 1 350 blue period 1 150 blue Period 1 500 period 2 250 blue 550 period 2 350 blue Period 2 600 Period 1 50 red period 1 40 red Period 1 90 period 2 175 red 177.5 period 2 90 red Period 2 265 WF13:V18 Final chart average sum of sales by period Team Average sum of sales Red 177.5 Blue 550
1 ACCEPTED SOLUTION
Solution Sage

I think something like the below should work for you.

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

3 REPLIES 3
Super User

Hi,

These measures work

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

Hhope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Solution Sage

I think something like the below should work for you.

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

Regular Visitor

Thanks so much I will give it a try

Announcements

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Power BI Monthly Update - May 2024

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

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors