Forum Discussion

JBESRI's avatar
JBESRI
Regular Visitor
2 years ago
Solved

Target change during the year

Hi all!   I'm looking for a solution for a problem I have. We are writing all work hours and some of those hours are for our customers. Some collagues have a target on how many % of their written h...
  • JBESRI's avatar
    2 years ago

    Above didn't help, but I found a solution.

    Made a table out of all the worked hours by day and employee, So i have in the columns Employee, day and in other columns for each type of work a column (pivot column). From there i needed the dax formula to retrieve the target by day.

    target =

    VAR CurrentDate = worked hours[date]
    RETURN
        CALCULATE (
            MAX ( Targettable ),
            FILTER (
                'AA targettest',
                'AA targettest'[Column1] = worked hours[Employee] &&
                'AA targettest'[Startdate] <= CurrentDate &&
                'AA targettest'[Enddate] >= CurrentDate
            )
        )