Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi community,
I'm having a problem to calculate a average.
There's two tables, a fact and a dimension (with goals), I made a relationship between them to get the goals.
Fact table is like that:
| Unit | Region | Real | Goal (this is a calculated column) |
| BEL | S | 1.2 | 1.0 |
| CGR | S | 0.9 | 0.8 |
| GYN | S | 0.73 | 1.0 |
| RBR | W | 0.89 | 0.8 |
| EST | E | 1.45 | 0.8 |
| MCP | S | 0.67 | 0.8 |
| STM | S | 0.49 | 0.8 |
| LEM | S | 1.53 | 0.8 |
| LAR | W | 0.89 | 0.8 |
| SLT | W | 0.89 | 0.8 |
| BUR | W | 0.89 | 1.0 |
| RIO | E | 1.45 | 0.8 |
| SMP | W | 0.89 | 1.0 |
| SHE | E | 1.45 | 0.8 |
Then, I used this Dax formula:
AVERAGE(fact_table[Goals])
And I got this when I use some filter for Region, in this case region "S":
The correct average should be: (2*1 + 4*0.8)/6 = 0.8667
What is happening?
Solved! Go to Solution.
@Anonymous the total of the matrix is not the average of the rows in it. It's the average of the underlying data without filters. You have different number of rows per unit. The total is the weighted average.
If what you want is the average of averages than write this:
Measure =
AVERAGEX(
VALUES(fact_table[Unit]),
CALCULATE(AVERAGE(fact_table[Goals]))
)
In case you put on the rows of the matrix the unit column from the dimension then swith in my function the VALUES(fact_table[Unit]) to VALUES(dim_table[Unit])
Many thanks, SpartaBI! You solved a problem I have been struggling with for days.
I'm, now its working, thank you!!!
@Anonymous my pleasure
@Anonymous the total of the matrix is not the average of the rows in it. It's the average of the underlying data without filters. You have different number of rows per unit. The total is the weighted average.
If what you want is the average of averages than write this:
Measure =
AVERAGEX(
VALUES(fact_table[Unit]),
CALCULATE(AVERAGE(fact_table[Goals]))
)
In case you put on the rows of the matrix the unit column from the dimension then swith in my function the VALUES(fact_table[Unit]) to VALUES(dim_table[Unit])
still doesnt work, I used the unit column from fact table
@Anonymous you didn't put the calculate around the average. Look at the measure I wrote. Don't forget to accept the solution 🙂
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 8 | |
| 7 | |
| 5 |