Forum Discussion
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(),
'Table'[Date - Departure (ETD)].[Date] + 7
),
IF(
[bar] = "Ey",
IF(
ISBLANK('Table1'[Date - Arrival (ETA)].[Date]),
BLANK(),
'001-statistik'[Date - Arrival (ETA)].[Date] + 13
),
IF(
[bar] = "Ez" ,
IF(
ISBLANK('Table1'[Date - Arrival (ETA)].[Date]),
BLANK(),
'Table1'[Date - Arrival (ETA)].[Date] + 16
),
BLANK()
)
)
)
Thanks,
3 Replies
- IdrissshatilaSuper User
Hello Mani_1 ,
Refer to this solution https://community.fabric.microsoft.com/t5/Desktop/Add-working-days-to-a-date/m-p/146945
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Follow me on Linkedin
Vote For my Ideađź’ˇ- Mani_1Frequent Visitor
Hello Idrissshatila ,
It is not the solution in my case, please check
- AnonymousNot 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 _table2To 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