Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

calculation with dates

Hi, I have a table with employees date joined by team and date left by team. As a result, employees end up in several rows. For example employed by team A from 1-1-2020 to 31-7-2021 and employed by t...
  • some_bih's avatar
    some_bih
    3 years ago

    Hi Anonymous 

    for Test measure use version below ) was on wrong place. Adding "working hours" to second table - not clear what you want. You already have it some table?

     

    Test =
    VAR _startdate=SELECTEDVALUE(formatie[date start])
    VAR _enddate=SELECTEDVALUE(formatie[date end])
    VAR _employee=SELECTEDVALUE(formatie[Name employee])
    VAR _Result=
        CALCULATE(
            [Workin_hours],
            FILTER('working hours',
            'working hours'[date]>=_startdate && 'working hours'[date]>=_enddate && 'working hours'[Name employee]=_employee
        )
    )
    RETURN _result