Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 53 | |
| 42 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 111 | |
| 104 | |
| 36 | |
| 28 | |
| 27 |