Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe'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
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 32 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |