Same column str detection and

Hi @kurzashane,

There’s a bit to it but Power Query is up to the task.

  1. Created a Table.Buffer step to load the Sorted table into memory.

  2. Created a nested table containing only the rows for the Current Job Requisition

  3. Added a Custom Column with the required logic

       if Text.Contains([#"Freeze/Unfreeze"], "Freeze") and [Job Approval date] < [#"Freeze/Unfreeze date"]      
          then List.Count(
             List.Select(
               List.Dates(
                 Record.Field(Table.Min([TempTable], "Freeze/Unfreeze date"), "Freeze/Unfreeze date"), 
                 Number.From(
                   Record.Field(Table.Max([TempTable], "Freeze/Unfreeze date"), "Freeze/Unfreeze date")
                 ) - Number.From(
                   Record.Field(Table.Min([TempTable], "Freeze/Unfreeze date"), "Freeze/Unfreeze date")
                 ) + 1, 
                 Duration.From(1)
               ), 
               each Date.DayOfWeek(_, 1) < 5
             )
           )
           else 0
    

.
For other posts, containing parts of this Power Query technique see:

.
I hope this is helpful. Here’s my sample file.
PQ working days job logic.pbix (29.8 KB)

1 Like