This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello.
I am trying to find the variance of a measure (SUM), from an average measure of the sum. Below is some simple data.
| Product | Area | Cost |
| Product1 | Area 1 | 10 |
| Product1 | Area 2 | 15 |
| Product1 | Area 3 | 20 |
| Product2 | Area 1 | 20 |
| Product2 | Area 2 | 25 |
| Product2 | Area 3 | 30 |
| Product3 | Area 1 | 30 |
| Product3 | Area 2 | 35 |
| Product3 | Area 3 | 40 |
The SUM measure may be CostSum = SUM(Table[Cost])
Desired matrix result:
| Area 1 Cost | Avg | Variance | Area 2 Cost | Avg | Variance | Area 3 Cost | Avg | Variance | |
| Product1 | 10 | 15 | -5 | 15 | 15 | 0 | 20 | 15 | 5 |
| Product2 | 20 | 25 | -5 | 25 | 25 | 0 | 30 | 25 | 5 |
| Product3 | 30 | 35 | -5 | 35 | 35 | 0 | 40 | 35 | 5 |
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,
Solved! Go to Solution.
Hi,
Write these measures
C = SUM(Data[Cost])Average product cost = AVERAGEX(ALL(Data[Area]),[C])Variance = [C]-[Average product cost]
Hope this helps.
Hi,
Write these measures
C = SUM(Data[Cost])Average product cost = AVERAGEX(ALL(Data[Area]),[C])Variance = [C]-[Average product cost]
Hope this helps.
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,
You are welcome.
I apologize, below is a better representation of the desired result.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 25 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 26 | |
| 20 | |
| 19 |