Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Conditional formatting matrix values based on other table column values

I have a matrix of employee hours as values, dates as columns and names as rows. I need to conditional format all the days for those employee where: 1) Date is more than hired date of employee and l...
  • Anonymous's avatar
    Anonymous
    5 years ago

    I got the answer. Thanks all for reading this. Here is what I did :

    I created measure for selected date hired, selected date released for the employee in the context.

     

    SelectedStaff = SELECTEDVALUE(table[table.employee]) to capture the staff in context
    Selected Date Hired = CALCULATE(MIN(Employee[Employee.dateHired]),FILTER(Employee,Employee[Employee.displayName] = [SelectedStaff])) to capture the hired date of employee in context
    Similar dax for date release. Finally created the outstanding flag with below formula:
    Outstanding flag = IF([WeekDay- Weekend] = "Weekday" && [Selected Date] >= [Selected Date Hired] && [Selected Date] <= MAX(TODAY(),[Selected Date Released]) && [Available Hours new] >= [Selected Daily Hours] ,1,0)
    Applied the conditional formatting through outstanding flag on the entered hours by rule. It worked