Forum Discussion
PamWren
2 years agoFrequent Visitor
Conditional Formatting in Power BI
Hi, I have a matrix which shows apprentices and planned end dates, with amounts paid per month for training. I want to highlight any payments made after the end date but I can't figure out how t...
Anonymous
2 years agoNot applicable
I made a sample power bi dataset based on how I think your data is structured, I have an employee table containing the employee name and the end date. I have another table called Payments which contains the employee; payment date and paid amount. These are linked on the employee name column. I believe the below meets your requirements:
The measure is effectively calculating the amount paid after the end date then returning a colour if the date in the table is larger than the end date and the paid amount after end date is not 0. Raw measure code:
Conditional Format Value =
VAR _end = SELECTEDVALUE(Employee[End Date])
VAR _check = CALCULATE(SUM(Payments[Paid Amount]), FILTER(ALL(Payments),
Payments[Employee] = SELECTEDVALUE(Employee[Employee])
&& Payments[Payment Date] > _end
)
)
RETURN
IF(_check <> 0 && SELECTEDVALUE(Payments[Payment Date]) > _end, "Yellow" /*Put your colour here, can be a hexcode*/, BLANK())
Hope this helps, let me know if you have any issues or further questions.