Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Part 2 - DAX formula for Calculated Column - Lead in time/ Remaining days to order

I am trying to create a calculated column to show count for 'Remaining days to order'. The count is based on Total working days minus 10 days lead time from the time order is placed to the time when ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous 
    So sorry for late reply, had busy time.

    You need to add the month and year filter to the variable b, try this dax:

     

    RemainingDaysToOrder = 
    var a=CALCULATE(MAX('Dates'[IsWorkingDay]),FILTER('Dates','Dates'[Date]=EARLIER(Dates[Date])-1))
    var b= CALCULATE(COUNTROWS('Dates'),FILTER('Dates','Dates'[Date]<EARLIER('Dates'[Date])&&'Dates'[IsWorkingDay]=0 && Dates[Date].[Month]=EARLIER(Dates[Date].[Month])&&[Date].[Year]=EARLIER([Date].[Year])))
    Return
    IF('Dates'[IsWorkingDay]=0,BLANK(),
    IF('Dates'[Column]+b>=1,'Dates'[Column]+b,1))

     

    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.