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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
curtismob
Helper IV
Helper IV

Variance From Average

Hello.

I am trying to find the variance of a measure (SUM), from an average measure of the sum.  Below is some simple data.

ProductAreaCost
Product1Area 110
Product1Area 215
Product1Area 320
Product2Area 120
Product2Area 225
Product2Area 330
Product3Area 130
Product3Area 235
Product3Area 340

 

The SUM measure may be CostSum = SUM(Table[Cost])

 

Desired matrix result:

 Area 1 CostAvgVarianceArea 2 CostAvgVarianceArea 3 CostAvgVariance
Product11015-51515020155
Product22025-52525030255
Product33035-53535040355

 

I hope this data is simple enough to copy and paste to Excel/csv and import into a pbix.  The main challenge is having the product average be the same, for each area in the row.

 

Thank you in advance,

@curtismob 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Write these measures

C = SUM(Data[Cost])
Average product cost = AVERAGEX(ALL(Data[Area]),[C])
Variance = [C]-[Average product cost]

Hope this helps.

Untitled.png


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

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Write these measures

C = SUM(Data[Cost])
Average product cost = AVERAGEX(ALL(Data[Area]),[C])
Variance = [C]-[Average product cost]

Hope this helps.

Untitled.png


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

Hi Ashish,  I am reviewing your solution and trying to test it with some actual data.  As you would expect, my actual data, with a couple of relationships involved, is not as simple as my example data for this post.  Your solution has given me some good direction.

 

Thank you for the quick response,

@curtismob

 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
curtismob
Helper IV
Helper IV

I apologize, below is a better representation of the desired result.

 

curtismob_0-1689535492543.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.