Forum Discussion
Mani_1
3 years agoFrequent Visitor
Adding working days to a date
Hi, How can i add 13 working days(i.e only weekdays ) to the date of arrival for the dax below? Date of del = IF( [bar] = "Ex", IF( ISBLANK('Table1'[Date - Departure (ETD)].[Date]), BLANK(), ...
Anonymous
3 years agoNot applicable
Hi Mani_1 ,
You need to create a calendar table:
Calenar_table =
var _table=
CALENDAR(
DATE(2023,1,1),DATE(2023,12,31))
var _table1=
FILTER(
_table,
NOT(
WEEKDAY(
[Date],2)) in {6,7}
)
var _table2=
ADDCOLUMNS(
_table1,"rank",RANKX(_table1,[Date],,ASC))
return
_table2
To create a calculated column:
add13 =
MAXX(
FILTER(ALL('Calenar_table'),'Calenar_table'[rank]=
MAXX(
FILTER(ALL('Calenar_table'),
'Calenar_table'[Date]=EARLIER('Table'[Date - Departure (ETD)])),[rank])+13),[Date])
Put it into your Dax according to your needs
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly