Forum Discussion
Transactions between dates with weekends
- 3 years ago
Hi Teachjanderson ,
You can calculate for the day of week of day name a disbursement date is and move it to the next weekday. That would be +1 for Sun and +2 for Saturday.
= VAR __DAY_OF_WEEK = WEEKDAY ( DisbursementDates[Disbursement date], 1 ) RETURN SWITCH ( __DAY_OF_WEEK, 1, DisbursementDates[Disbursement date] + 1, 7, DisbursementDates[Disbursement date] + 2, DisbursementDates[Disbursement date] )As for the expected disbursement date of each transaction and following that if the date is 4/15 the disbursement date would be 4/17, you can calculate for the earliest expected disbursement date that is greater than the current transaction date.
= CALCULATE ( MIN ( DisbursementDates[Expected Disbursement Date] ), FILTER ( DisbursementDates, DisbursementDates[Expected Disbursement Date] > EARLIER ( TransactionDates[Transaction date] ) ) )
Hi Teachjanderson ,
You can calculate for the day of week of day name a disbursement date is and move it to the next weekday. That would be +1 for Sun and +2 for Saturday.
=
VAR __DAY_OF_WEEK =
WEEKDAY ( DisbursementDates[Disbursement date], 1 )
RETURN
SWITCH (
__DAY_OF_WEEK,
1, DisbursementDates[Disbursement date] + 1,
7, DisbursementDates[Disbursement date] + 2,
DisbursementDates[Disbursement date]
)
As for the expected disbursement date of each transaction and following that if the date is 4/15 the disbursement date would be 4/17, you can calculate for the earliest expected disbursement date that is greater than the current transaction date.
=
CALCULATE (
MIN ( DisbursementDates[Expected Disbursement Date] ),
FILTER (
DisbursementDates,
DisbursementDates[Expected Disbursement Date]
> EARLIER ( TransactionDates[Transaction date] )
)
)