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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi
i do have a task where I really have no idea how to solve it
We have a production of a part (ArticleID). Each part has several operations (OP) and every OP has a planned worktime per piece.
At some of the operations we put the produced quantity into the system.
e.g. article 1004 does have the OP 10, 20, 30 and 40. At OP 10 and 40 we do the entry into the system. A booking at OP 40 means that OP 20 and OP 30 was also done already but not yet booked. OP10 was also done but is already booked
Now, at the day of entry I need to calculate the used worktime. Issue is, how to I backflash and find all OP between in last Booking point (OP10) and current booking point (OP40) and use the same qty as booked in OP40 for the found OPs (OP 20, OP 30 and OP 40).
The real data is quiet big, not sure how if e.g. a powerquery is the easiest with some fill up/down in terms of performance
thanks
A sample file is here
Solved! Go to Solution.
Hi @Hansolu , this is a classic backflushing problem in production reporting, you need to infer the implied completion of intermediate operations when a later operation is booked, using the latest available entry as reference.
For each ArticleID:
When a later operation (say OP40) is booked,
You want to “backflush” and assign the same quantity to all unbooked operations between the previous booking (e.g. OP10) and the current one (e.g. OP40).
Then calculate worktime used = PlannedTime × Quantity for those operations.
In Power Query:
Sort by ArticleID → OP ascending → BookingDate ascending.
Ensure you have these fields:
ArticleID
OP
BookingDate (or entry date)
PlannedTimePerPiece
BookedQty (null if not booked)
Create a flag column:
IsBooked = if [BookedQty] <> null then 1 else 0
This lets you mark where bookings exist.
Use Power Query’s Fill Down logic:
Add an index column for order.
Group by ArticleID.
Within each group:
Fill down the most recent booked operation number (LastBookedOP).
Also fill down booked quantity (LastBookedQty).
Now every row (operation) will know:
Which was the last booking point before it,
And what quantity was booked.
Add a conditional column:
ShouldBackflush =
if [IsBooked] = 1 then 1
else if [OP] > [LastBookedOP] and [NextBookedOP] <= [OP] then 1
else 0This marks all intermediate OPs (e.g., OP20, OP30) that fall between the last and next booking.
Tip: To get NextBookedOP, perform a reverse fill-down (fill-up technique): sort descending, fill down the next booked OP number, then merge it back.
BackflushQty = if [IsBooked] = 1 then [BookedQty] else [NextBookedQty]
UsedWorktime = [PlannedTimePerPiece] * [BackflushQty]
Given your data is large:
Perform grouping and fill operations per ArticleID (not globally).
Avoid nested Table.Buffer() calls unless necessary.
If you have SQL backend access, consider doing the backflushing logic in SQL before Power BI import — it’s faster.
If you need to calculate this dynamically in Power BI (not precomputed in PQ):
Create a measure to detect the latest booking OP for each article/date:
LastBooking =
CALCULATE(
MAX('Table'[OP]),
FILTER('Table',
'Table'[ArticleID] = SELECTEDVALUE('Table'[ArticleID]) &&
NOT(ISBLANK('Table'[BookedQty]))
)
)Then use that measure to conditionally assign quantities or times:
UsedWorktime =
VAR CurrentOP = SELECTEDVALUE('Table'[OP])
VAR LastBookedOP = [LastBooking]
RETURN
IF(CurrentOP <= LastBookedOP,
SUMX(
FILTER('Table', 'Table'[OP] <= LastBookedOP),
'Table'[PlannedTimePerPiece] * 'Table'[BookedQty]
)
)Hi @Hansolu ,
Could you let me know if your issue has been resolved or if you still need any more information? If you need further help, please let us know.
Hi,
got some other urgents topic on my hand and did not yet continure, will take another few weeks until I can continue here. I will keep this thread updated,
thanks
Hi @Hansolu ,
Just checking in to see if you’ve had a chance to look over @GrowthNatives response. If you have any additional questions, please let us know, we’re here to help. Thank you for being part of the Microsoft Fabric Community Forum.
Best regards,
Yugandhar.
Hi @Hansolu , this is a classic backflushing problem in production reporting, you need to infer the implied completion of intermediate operations when a later operation is booked, using the latest available entry as reference.
For each ArticleID:
When a later operation (say OP40) is booked,
You want to “backflush” and assign the same quantity to all unbooked operations between the previous booking (e.g. OP10) and the current one (e.g. OP40).
Then calculate worktime used = PlannedTime × Quantity for those operations.
In Power Query:
Sort by ArticleID → OP ascending → BookingDate ascending.
Ensure you have these fields:
ArticleID
OP
BookingDate (or entry date)
PlannedTimePerPiece
BookedQty (null if not booked)
Create a flag column:
IsBooked = if [BookedQty] <> null then 1 else 0
This lets you mark where bookings exist.
Use Power Query’s Fill Down logic:
Add an index column for order.
Group by ArticleID.
Within each group:
Fill down the most recent booked operation number (LastBookedOP).
Also fill down booked quantity (LastBookedQty).
Now every row (operation) will know:
Which was the last booking point before it,
And what quantity was booked.
Add a conditional column:
ShouldBackflush =
if [IsBooked] = 1 then 1
else if [OP] > [LastBookedOP] and [NextBookedOP] <= [OP] then 1
else 0This marks all intermediate OPs (e.g., OP20, OP30) that fall between the last and next booking.
Tip: To get NextBookedOP, perform a reverse fill-down (fill-up technique): sort descending, fill down the next booked OP number, then merge it back.
BackflushQty = if [IsBooked] = 1 then [BookedQty] else [NextBookedQty]
UsedWorktime = [PlannedTimePerPiece] * [BackflushQty]
Given your data is large:
Perform grouping and fill operations per ArticleID (not globally).
Avoid nested Table.Buffer() calls unless necessary.
If you have SQL backend access, consider doing the backflushing logic in SQL before Power BI import — it’s faster.
If you need to calculate this dynamically in Power BI (not precomputed in PQ):
Create a measure to detect the latest booking OP for each article/date:
LastBooking =
CALCULATE(
MAX('Table'[OP]),
FILTER('Table',
'Table'[ArticleID] = SELECTEDVALUE('Table'[ArticleID]) &&
NOT(ISBLANK('Table'[BookedQty]))
)
)Then use that measure to conditionally assign quantities or times:
UsedWorktime =
VAR CurrentOP = SELECTEDVALUE('Table'[OP])
VAR LastBookedOP = [LastBooking]
RETURN
IF(CurrentOP <= LastBookedOP,
SUMX(
FILTER('Table', 'Table'[OP] <= LastBookedOP),
'Table'[PlannedTimePerPiece] * 'Table'[BookedQty]
)
)Hi
thnanks, i will try this over the weekend when I do have time
will give feedback afterwards
Hi, one screenshot is in the pbix file how it should look like,
Which one do you need else?
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!