Forum Discussion
calculation with dates
- 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
Hi Anonymous I assume employee belong to some team and there is some table. This table should be connected with relationship and we will see the result. In what table we could find this?
Hi som_bih, the problem is the emplyee has several lines because it belognes during time to sevral teams. you get a many to many relationship, els it would be easy.
To get the right team at time hours worked it should look at the date en then find the right team.
- some_bih3 years agoCommunity Champion
Hi Anonymous still, one employee belong to only one team at certain day? Or...
- Anonymous3 years agoNot applicable
yes, that is right.
- Anonymous3 years agoNot applicable
Hi some_bih, that is right.
Do you know how I can add a column to the table below?
Table working hours:
Name employee date working hours Magret 5-1-2023 3 Magret 8-1-2023 5 Magret 15-1-2023 6 Magret 16-1-2023 2 Magret 25-1-2023 6 Magret 29-1-2023 4 Magret 17-2-2023 8 Magret 18-2-2023 4 Magret 8-3-2023 8 Magret 15-3-2023 8 Magret 16-3-2023 6 There is a many to many relationship between the table "working hours" and "employee"/
For every line in the new column it need to look in the table "employee" at which team the employee belongs at a certain day.
Do you have a suggestion?
- some_bih3 years agoCommunity Champion
Hi Anonymous please share file with me so I can see overall model. Describe wanted solution so I can check what I can do.