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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello everybody,
i´m struggeling with a average calculation in my power bi report. Target what i would like to achieve is, to calculate the
My Table "PLANTS" structure looks following:
| Plant Code | Plant Material | MRP Controller | Attribut | Amount | |||||
| 8401 | 2402000508 | 600 | Req./Day | 34,1 | |||||
| 8401 | 2402000508 | 600 | Actual Range | 16,6 |
| ||||
| 8401 | 2402000508 | 600 | Stock | 200 |
| ||||
| 7601 | 494600125 | 500 | Req./Day | 10 | |||||
| 7601 | 4946000125 | 500 | Actual Range | 3 | |||||
| 7601 | 4946000125 | 500 | Stock | 3000 |
The calculation what i did was following:
1. I created a SUM Measure with following Code:
SUM Plants =
@tobisw , This formula, will avg above 'Plants'[MRP Contr.] level
AVERAGEX(
KEEPFILTERS(VALUES('Plants'[MRP Contr.])),
CALCULATE([Actual_range])
)
or
AVERAGEX(
VALUES('Plants'[MRP Contr.]),
CALCULATE([Actual_range])
)
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
You mean, that my formula is not correct? Sorry, i´m not sure if i understood your right. By using your formula the result is the same...
Hi @tobisw ,
I have a test by your code. And get result as below.
I think the average of "Acutal_range" in each [MPR Controller] is correct.
For [MPR Controller] = 500, average of "Acutal_range" = 3/1
For [MPR Controller] = 600, average of "Acutal_range" = 166/1
Subtotal = (3+166)/2
Could you show a screenshot with the result you want to me?
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
| User | Count |
|---|---|
| 51 | |
| 38 | |
| 33 | |
| 22 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 101 | |
| 58 | |
| 36 | |
| 35 |