Forum Discussion
TARGET ADJUSTMENT
Hello !
I need to calculate the target adjustment based on the end date of the parental leave.
I have attached an example with the "ABC" employee:
| EMPLOYEE | EMPLOYEE_PROFESSION | PATERNAL_START | PATERNAL_END |
| ABC | SENIOR | 1-Jan-21 | 1-Mar-22 |
| ACD | JUNIOR | 1-Feb-20 | 1-Dec-21 |
She returned from parental leave in March 2022. She will have a target reduced by 50%. Next month, the target will be 100%.
EMPLOYEE | MONTH | TARGET_ADJUSTMENT_PERCENT |
| ABC | JAN | 0% |
| FEB | 0% | |
| MAR | 50% | |
| APR | 100% | |
| MAY | 100% |
TARGET TABLE:
| EMPLOYEE_PROFESSION | KPI | TARGET |
| SENIOR | LOANS | 1000 |
| SENIOR | DEPOSITS | 1000 |
| JUNIOR | LOANS | 500 |
| JUNIOR | DEPOSITS | 250 |
How can I model the tables TO GET THE MONTHLY TARGET FOR EACH EMPLOYEE ?
Thanks!
- Anonymous4 years ago
Hi Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a date table.
calendar = CALENDAR(DATE(2020,1,1),DATE(2022,12,31))Then create two columns.
Co_month = MONTH('calendar'[Date])col_year = YEAR('calendar'[Date])Finally create a measure.
Measure = VAR _endmonth = MONTH ( MAX ( 'ABC employee'[PATERNAL_END] ) ) VAR _endyear = YEAR ( MAX ( 'ABC employee'[PATERNAL_END] ) ) VAR _start = MAX ( 'ABC employee'[PATERNAL_START] ) VAR _end = MAX ( 'ABC employee'[PATERNAL_END] ) RETURN IF ( MAX ( 'calendar'[Date] ) >= _start && MAX ( 'calendar'[Date] ) < _end, 0, IF ( MAX ( 'calendar'[Co_month] ) = _endmonth && MAX ( 'calendar'[col_year] ) = _endyear, 0.5, 1 ) )If I have misunderstood your meaning, please provide more details with your desired output (It's best to use pictures like me).
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a date table.
calendar = CALENDAR(DATE(2020,1,1),DATE(2022,12,31))Then create two columns.
Co_month = MONTH('calendar'[Date])col_year = YEAR('calendar'[Date])Finally create a measure.
Measure = VAR _endmonth = MONTH ( MAX ( 'ABC employee'[PATERNAL_END] ) ) VAR _endyear = YEAR ( MAX ( 'ABC employee'[PATERNAL_END] ) ) VAR _start = MAX ( 'ABC employee'[PATERNAL_START] ) VAR _end = MAX ( 'ABC employee'[PATERNAL_END] ) RETURN IF ( MAX ( 'calendar'[Date] ) >= _start && MAX ( 'calendar'[Date] ) < _end, 0, IF ( MAX ( 'calendar'[Co_month] ) = _endmonth && MAX ( 'calendar'[col_year] ) = _endyear, 0.5, 1 ) )If I have misunderstood your meaning, please provide more details with your desired output (It's best to use pictures like me).
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.