Forum Discussion
LastWorkDate QlikView Function to Power BI
- 8 years ago
Hi,
Instead of adding 4 days I've tried to add only 1 to the formula. But my surprise is that if use it for the day '23/10/2017', it returns '25/10/2017' instead of '24/10/2017'.
I've found the solution:
aux_LastWorkDate(SHIPPING_DATE) = CALCULATE( MIN(MyCalendar[Date]); FILTER( ALL(MyCalendar); MyCalendar[Date] >= (SHIPPING_DATE.[Date] + 1) && MyCalendar[isWorkDay] = 1 ) )I don't know why this works as the date should is the same.
Thanks for the answer, v-ljerr-msft !
Just a question from a noob like me: why are you using a variable? Wouldn't be the same if I write:
=
CALCULATE (
MIN ( 'Date'[Date] ),
FILTER (
ALL ( 'Date' ),
'Date'[Date]
>= SHIPPING_DATE + 4
&& 'Date'[IsWorkday] = 1
)
)Hi elxaxe,
Thanks for point that out! The formulas are the same, and it's simpler to use your formula in this scenario. It seems to be that I have been used to use the VAR functions to write DAX formulas. :smileylol:
Regards
- elxaxe8 years ago
Advocate I
Hi,
Instead of adding 4 days I've tried to add only 1 to the formula. But my surprise is that if use it for the day '23/10/2017', it returns '25/10/2017' instead of '24/10/2017'.
I've found the solution:
aux_LastWorkDate(SHIPPING_DATE) = CALCULATE( MIN(MyCalendar[Date]); FILTER( ALL(MyCalendar); MyCalendar[Date] >= (SHIPPING_DATE.[Date] + 1) && MyCalendar[isWorkDay] = 1 ) )I don't know why this works as the date should is the same.