Search code examples
datepowerbidaxcalculated-columns

Difference in work days between two dates


I am trying to create a calculated column to calculate the difference in work days between two dates based on a work day steering table.

In the work day steering table, the bank days are flagged as 0 and work days as 1.

What DAX formula should I use to create a calculated column to get the difference in work days between two dates?

Expected Result in yellow:
Output

Work day steering table:
Work day steering table


Solution

  • You can count the dates where BankDay = 1.

    WorkDays_CalculatedColumn =
    COUNTROWS (
        FILTER (
            WorkDaySteering,
            WorkDaySteering[BankDay] = 1
                && WorkDaySteering[Date] > Input[Ship Date]
                && WorkDaySteering[Date] <= Input[Delivery Date]
        )
    )