Forum Discussion
Conditional formatting not working on measure
- 6 years ago
Hi Anonymous and natabird3
I was responding to the post below and got your post also.
As refered by v-juanli-msft mMeasure are based on context so when you have the calculation of the measure without reference to any other calcuttion the aggregation doesn't return any background colour.
Believe that is the behaviour of the table visualization since you can add different levels of context and by default it's summarized with totals if you had an additional level of context as it's refered by adding the column 1 the formatting is applied.
If you use the condittional formatting on a card or a bar chart since the context is based on the slicer and on that visualization it will work correctly.
I agree that this is not user friendly and doesn't make sense. I will put an issue on the forum refering to this.
Thanks for responding v-juanli-msft
I tried in my real dashboard. I have 3 measures as below:
- msr_TotalSalary&Wages_Actual = CALCULATE( SUM(vAcctSumryBS[Dr_Cr]) , vAcctSumryBS[Category] ="Salary & Wages")
- msr_TotalSalary&Wages_Forecast = CALCULATE( SUM(vAcctSumryBS[ForecastAmt]) , vAcctSumryBS[Category] ="Salary & Wages")
- msr_TotalSalary&Wages_Variance_AvF = [msr_TotalSalary&Wages_Actual] - [msr_TotalSalary&Wages_Forecast]The value of msr_TotalSalary&Wages_Variance_AvF is negative. When I apply rule based formatting to it, it still does not change its color. I have checked it in Desktop Feb release as well. I tried it against a high number for msr_TotalSalary&Wages_Actual as well. It does not change colors.Your expression for your measure is similar to mine, and yet I do not get the colors. Only difference I see is that you are using ALL.Can you please help again?
Hi Anonymous and natabird3
I was responding to the post below and got your post also.
As refered by v-juanli-msft mMeasure are based on context so when you have the calculation of the measure without reference to any other calcuttion the aggregation doesn't return any background colour.
Believe that is the behaviour of the table visualization since you can add different levels of context and by default it's summarized with totals if you had an additional level of context as it's refered by adding the column 1 the formatting is applied.
If you use the condittional formatting on a card or a bar chart since the context is based on the slicer and on that visualization it will work correctly.
I agree that this is not user friendly and doesn't make sense. I will put an issue on the forum refering to this.
- Anonymous6 years agoNot applicable
Don't mean to pester you.. Being lazy; rather than check it for myself I wil ask you: have you gotten any tracktion on the "I will put an issue on the forum refering to this."? 😁 Is this a recognised issue and is there a pending fix?
- MFelix6 years ago
Super User
Hi Anonymous ,
This is posted on the following post https://community.powerbi.com/t5/Issues/Condittional-formatting-table-using-measures/idi-p/929891.
Although they didn't answer this question the problem is currently solved.
I downloaded the original file I used for the post and is working properly
Check PBI file attach.
- Anonymous6 years agoNot applicable
Interesting. I also did a test with Powerbi regular Desktop June 2020 (aka Cloud? I get so confused by the naming of these versions!) versus the on-prem Server Desktop Jan-2020 verion (aka "black icon").
Result: Works on June-2020, does not work on Server Jan-2020. Hope Server gets that fixed soon.