Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Lead time calculation based on predecessors

Dear community members,

 

I am trying to find a solution for a lead time calculation which is based on single confirmations in a process.

 

My table in Power BI looks like this (sorted for order number):

table_power_bi.PNG

 

I would like to calculate the lead time between two confirmations (rows).

The calculation itself is only ISDD - ISDD Predecessor.

 

However, I don't know how to get the predecessor date and time.

The dependency/logic would be for each predecessor cell:

  1.  search for the same order number and an activity number which is lower than its own
  2. if there is no lower activity number, cell = zero
  3. copy the ISDD to the cell

I've tried it in excel before. With sorting it is more less easy, but I don't know how to do it here.

 

Any ideas how to solve this?

 

Thanks in advance!

1 ACCEPTED SOLUTION
patoduck
Helper III
Helper III

Add a column =

 

ISDD predecessor=
CALCULATE (
    MAX ( YourTableName[ISDD]),
    (
        FILTER (
            YourTableName,
            EARLIER (YourTableName[Order] ) = YourTableName[Order]
                && EARLIER ( YourTableName[ISDD] ) > YourTableName[ISDD]
        )
    )
)

Without the workbook is hard to get it right, but try that first 🙂

Lastly the difference in day you get it like this:
add  column

=DATEDIFF([ISDD predecessor],[ISDD],DAY)

View solution in original post

1 REPLY 1
patoduck
Helper III
Helper III

Add a column =

 

ISDD predecessor=
CALCULATE (
    MAX ( YourTableName[ISDD]),
    (
        FILTER (
            YourTableName,
            EARLIER (YourTableName[Order] ) = YourTableName[Order]
                && EARLIER ( YourTableName[ISDD] ) > YourTableName[ISDD]
        )
    )
)

Without the workbook is hard to get it right, but try that first 🙂

Lastly the difference in day you get it like this:
add  column

=DATEDIFF([ISDD predecessor],[ISDD],DAY)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.