Forum Discussion
Anonymous
6 years agoNot applicable
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 ...
- Anonymous6 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.
Anonymous
6 years agoNot applicable
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.
Anonymous
6 years agoNot applicable
Paul,
YOU ARE A GENIOUS!
That worked! Thank you so much for your assistance. Greatly Appreciated, my friend!
Please stay safe.