Forum Discussion
JoeJames
1 year agoNew Member
Help in creating a calculated column
Hi The table visualization below shows some of the fields that I have in my data table. Transmittal sent is a column coming from a table called TRN History WF Completed Date is a column in the Do...
- Anonymous1 year ago
Hi JoeJames ,
You can try formula like below to create calculated column:
WorkdaysBetween = VAR StartDate = 'Table'[StartDate] VAR EndDate = 'Table'[EndDate] VAR TotalDays = DATEDIFF(StartDate, EndDate, DAY) VAR Weekends = COUNTROWS( FILTER( ADDCOLUMNS( CALENDAR(StartDate, EndDate), "DayOfWeek", WEEKDAY([Date], 2) ), [DayOfWeek] = 6 || [DayOfWeek] = 7 ) ) RETURN TotalDays - WeekendsBest Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
1 year agoNot applicable
Hi JoeJames ,
You can try formula like below to create calculated column:
WorkdaysBetween =
VAR StartDate = 'Table'[StartDate]
VAR EndDate = 'Table'[EndDate]
VAR TotalDays = DATEDIFF(StartDate, EndDate, DAY)
VAR Weekends =
COUNTROWS(
FILTER(
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"DayOfWeek", WEEKDAY([Date], 2)
),
[DayOfWeek] = 6 || [DayOfWeek] = 7
)
)
RETURN
TotalDays - Weekends
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.