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! Get ahead of the game and start preparing now! Learn more
Hi,
I am having difficulties with summing up my analysis using multiple If statements and measures.
I'm trying to define how much of my missed production (MP) is coming due to operational errors. These can be defined by; if 0<uptime<1 (except when covid) then operational error and all the missed production should be attributed to this measure (see MP_ops measurement).
Basically it works fine, but then when I want to sum it up on a monthly/yearly basis, the result remains zero.
Therefor I thought, I should be using sumx, so my final measure is
MP_ops_sum = sumx(flow_data_forecast,[MP_Ops])
And from the table below you can see that I then get monthly/yearly totals.
However at some days, there is no missed production according to my IF statements (MP_Ops), but then when using the sumx function, there is some missed production.
I am working with quite some measures, but I think these are all working fine and I believe the error lies in the last measure; MP_ops.
This is my code
MP_Ops = if([Total Missed Production]>0, if([MP_Covid]>0,0,if([Uptime_Field]=0 , [Total Missed Production], if([Uptime_Field]<1,if([MP_Correction]>[Total Missed Production]||[MP_Correction]=0,[Total Missed Production],[MP_Correction]),0))),0)MP_Correction = [Total Gross Sales boe]/[Uptime_Field]-[Total Gross Sales boe]
Any help is really appreciated.
Regards,
Gerlof
Solved! Go to Solution.
@GerlofVisser , Try like
MP_ops_sum = sumx(values(flow_data_forecast[Date]),[MP_Ops])
Wow, that did the trick and it seemed like an easy fix!
Thanks!
Can you explain a bit more on this or direct me to an explanation page?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 36 | |
| 32 | |
| 31 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |