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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Yes123
Frequent Visitor

Help with Average per team distribution

Okay, so I have searched for a solution but have not been able to solve it. I guess I should use AverageX, but how is the question? 

Might just be easier to look at the picture below. So I have a sales amount per team and product. After creating a % within each team I want the Average of all teams.
I have dimensions for Date, Team and Product (if needed).
Thanks in advance!

 

Yes123_0-1622210735453.png

 

1 ACCEPTED SOLUTION

You can aggregate subtotal averages rather than a standard average like this:

AVERAGEX ( VALUES ( Sales[Team] ), [ProductAvg] )

where [ProductAvg] is whatever measure you already have defined, presumably something like

DIVIDE (
    SUM ( Sales[Amount] ),
    CALCULATE ( SUM ( Sales[Amount] ), ALLSELECTED ( Sales[Product] ) )
)

View solution in original post

6 REPLIES 6
Yes123
Frequent Visitor

I know it is slightly weird, but yes, that is how I need it.

You can aggregate subtotal averages rather than a standard average like this:

AVERAGEX ( VALUES ( Sales[Team] ), [ProductAvg] )

where [ProductAvg] is whatever measure you already have defined, presumably something like

DIVIDE (
    SUM ( Sales[Amount] ),
    CALCULATE ( SUM ( Sales[Amount] ), ALLSELECTED ( Sales[Product] ) )
)

One question though and I'm sure this a stupid one... It works fine, but why can't I have the [ProductAvg] as a VAR? Doing it that way it is slightly of

Measure =
VAR Per_Team = DIVIDE (
    SUM ( Sales[Amount] ),
    CALCULATE ( SUM ( Sales[Amount] ), ALLSELECTED ( Sales[Product] ) )
)
Return AVERAGEX(VALUES(Sales[Team]),Per_Team)

 

When you declare a variable, it is computed once and reused as a constant through the rest of the measure, so you'd be averaging the same value ignoring the Team.

Awesome! Looks so simple, once you know. Thank you!

AlexisOlson
Super User
Super User

Why do you want ( (10/100) + (3/10) ) / 2 = 20% instead of the more standard average calculation (10+3)/(100+10) = 11.8%?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors