Forum Discussion
jl20
8 years agoHelper IV
Working Days Calc - Need Help
Hi all, I'm having a lot of trouble writing the syntax for a seemingly simple requirement. Table 1: [employee name] [last worked date] Table 2: Standard date table, ending with today's d...
- 8 years ago
Hey, you can use this DAX statement to calculate the total available workingdays
Total Working Days = VAR mytable = ADDCOLUMNS ( GENERATESERIES ( DATE ( YEAR ( employee[LastWorkingDate] ), MONTH ( 'employee'[LastWorkingDate] ), 1 ), DATE ( YEAR ( employee[LastWorkingDate] ), MONTH ( 'employee'[LastWorkingDate] )+1, 1) -1 ), "Week_Day", WEEKDAY ( [Value], 2 ) ) RETURN COUNTROWS ( FILTER ( mytable, [Week_Day] <= 5 ) )Here is a little screenshot
Zubair_Muhammad
8 years agoCommunity Champion
TomMartens
8 years agoSuper User
Zubair_Muhammad an elegant usage of GENERATESERIES(...)