Forum Discussion
Conditional Formatting Quirks
OK sure thing,
So the measure I have for variance is as follows:
Forecasted Variance = (Calculate(COUNTROWS(Headcount), Headcount[Current Status] = "Established") + (Calculate(COUNTROWS(Headcount), Headcount[Current Status] = "New Starter")) - SUM(HCBudget[HC Value])
This then generates the difference in absolute terms between the total of Established and New Starter employees minus the value in the budget column.
I then have 2 slicers for the budget year and type (e.g. 2019 provisional) and the specific dates we are looking at.
Hi tobiasmcbride ,
I have checked the information you have gave me and based on the post below I have understood what is happening.
https://community.powerbi.com/t5/Desktop/Conditional-formatting-not-working-on-measure/td-p/621171
Measure are based on context so when you have the calculation of the measure without reference to the year you are filtering it will not return the background colour.
Be aware that this is because of the table visualization since you are adding additional levels of context. If you use the condittional formatting on a card since the context is based on the slicer and on the card it will work normally.
Not sure if this fits your needs but if you place a column with the year on your table that will return the condittional formatting as you need.
You can hide the column of the year by reducing it as much as possible. I'm assuming that you will not select more than 1 year.
See attach the PBIX file.(on the file the totals are turn on but it's not necessary to have then turn on.