Forum Discussion
Add Work Days with Custom Calendar
- Anonymous1 year ago
Hi datachick2024 ,
Thanks for amitchandak's reply!
And datachick2024 , here is my sample data (To save time, I use 45702Site X for all Date_Site_Key here):Because I don't know what your data model looks like, I didn't create Dim Date Table.
Then I use this DAX to create a measure:Est_Ship_Date = VAR OrderDate = SELECTEDVALUE('End Date'[Order Date]) VAR CurrentSite = SELECTEDVALUE('End Date'[Site]) VAR DelayWD = SELECTEDVALUE('End Date'[Shipment_Delay_WD]) VAR CurrentKey = SELECTEDVALUE('End Date'[Date_Site_Key]) VAR WorkingDaysAfterOrder = CALCULATETABLE( ADDCOLUMNS( FILTER( 'Working Day', 'Working Day'[Site] = CurrentSite && 'Working Day'[Date_Site_Key] = CurrentKey && 'Working Day'[Date] >= OrderDate && 'Working Day'[Working Day] = "Yes" ), "CumulativeWorkDays", RANKX( FILTER( 'Working Day', 'Working Day'[Site] = CurrentSite && 'Working Day'[Date_Site_Key] = CurrentKey && 'Working Day'[Date] >= OrderDate && 'Working Day'[Working Day] = "Yes" ), 'Working Day'[Date], , ASC ) ) ) VAR EstimatedDate = MAXX( FILTER( WorkingDaysAfterOrder, [CumulativeWorkDays] = DelayWD ), 'Working Day'[Date] ) RETURN EstimatedDateAnd the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
datachick2024 , Please check my blog, if that can help
https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calendar-4-5-Power/ba-p/1187766
Solution for column is in comment.
This is helpful, thank you. However, I need to be able to make the "10" to a dynamic value as well
- Anonymous1 year agoNot applicable
Hi datachick2024 ,
Thanks for amitchandak's reply!
And datachick2024 , here is my sample data (To save time, I use 45702Site X for all Date_Site_Key here):Because I don't know what your data model looks like, I didn't create Dim Date Table.
Then I use this DAX to create a measure:Est_Ship_Date = VAR OrderDate = SELECTEDVALUE('End Date'[Order Date]) VAR CurrentSite = SELECTEDVALUE('End Date'[Site]) VAR DelayWD = SELECTEDVALUE('End Date'[Shipment_Delay_WD]) VAR CurrentKey = SELECTEDVALUE('End Date'[Date_Site_Key]) VAR WorkingDaysAfterOrder = CALCULATETABLE( ADDCOLUMNS( FILTER( 'Working Day', 'Working Day'[Site] = CurrentSite && 'Working Day'[Date_Site_Key] = CurrentKey && 'Working Day'[Date] >= OrderDate && 'Working Day'[Working Day] = "Yes" ), "CumulativeWorkDays", RANKX( FILTER( 'Working Day', 'Working Day'[Site] = CurrentSite && 'Working Day'[Date_Site_Key] = CurrentKey && 'Working Day'[Date] >= OrderDate && 'Working Day'[Working Day] = "Yes" ), 'Working Day'[Date], , ASC ) ) ) VAR EstimatedDate = MAXX( FILTER( WorkingDaysAfterOrder, [CumulativeWorkDays] = DelayWD ), 'Working Day'[Date] ) RETURN EstimatedDateAnd the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.