Forum Discussion
Conditional Formatting Quirks
Hi
I have checked and the measure is formatted as a number and still not working.
Hic tobiasmcbride ,
Witouth any example is difficult to give you a better explanation, can you share some mockupdata and the measure you are using to calculate the Variance?
If this is sensitive information you canshare it trough private message or with mockup values, as I refered to you I have made some test and was abble to make the condittional formatting but my model for sure is not equal to yours is just a simple column with forecast and budget columns.
- MFelix6 years agoSuper User
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.
- tobiasmcbride6 years agoHelper III
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.
- tobiasmcbride6 years agoHelper III
I then take this variance data and put it in a visual table for the report with the forecast value (which is the first part of the H/C variance essentially) and compare it with the budget figure.
Forecast Budget Variance 180 190 -10 It is the latter column on the table in the report (visual table) that I want conditionally formatted and it refuses to do so depsite entering the correct rule set.
- Anonymous6 years agoNot applicable