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 have the following table:
| Prod_ Order No_ | Operation No_ | Previous Operation No_ | Posting_Date | Output QTY from operation | "Delay" |
| MO000305 | 310 | 309 | 10/24/2019 | 1 | 0 |
| MO000305 | 311 | 310 | 10/25/2019 | 1 | 1 |
| MO000305 | 312 | 311 | 10/25/2019 | 1 | 0 |
| MO000305 | 313 | 312 | 10/26/2019 | 1 | 1 |
| MO000305 | 314 | 313 | 10/27/2019 | 1 | 1 |
i need count the days between every operation, only for the the one that didnot occur on the same day,and make a total count for these days as "delay days".( i have added the delay coulmn)
on the original table i have many "prod _order_NO" with many operations and dates and QTY.
i need in the calcualtion to stop when the last operation is the current operation, and prudece the following:
| Prod_ Order No_ | Operation No_ | Previous Operation No_ | Delay days | Output QTY |
| MO000305 | 314 | 313 | 3 | 1 |
thanks!!!!
Ofir
Solved! Go to Solution.
@Anonymous ,
If I understand the issue, try this: My table is prodDelay
Delay sum = var _maxNo = CALCULATE(MAX(prodDelay[Operation No_]),ALLEXCEPT(prodDelay,prodDelay[Prod_ Order No_])) var _sumDelay = CALCULATE(SUM(prodDelay[Delay]), ALLEXCEPT(prodDelay,prodDelay[Prod_ Order No_])) return IF(prodDelay[Operation No_] = _maxNo,_sumDelay)
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
@Anonymous ,
If I understand the issue, try this: My table is prodDelay
Delay sum = var _maxNo = CALCULATE(MAX(prodDelay[Operation No_]),ALLEXCEPT(prodDelay,prodDelay[Prod_ Order No_])) var _sumDelay = CALCULATE(SUM(prodDelay[Delay]), ALLEXCEPT(prodDelay,prodDelay[Prod_ Order No_])) return IF(prodDelay[Operation No_] = _maxNo,_sumDelay)
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Hi!
Thank you very much for the response.
do you use the "ALLEXCEPT" function to be able to isolate between the "
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 13 | |
| 10 |