Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good Morning,
I'm hoping somebody can help me out before I drive myself crazy. I have been working on Conditional formatting of some KPI comparing individual managers to the company wide "mean". I have a basic switch measure like this :
Solved! Go to Solution.
Create a measure
Measure = VAR mean1 = CALCULATE ( AVERAGE ( Sheet4[c2] ), FILTER ( ALL ( Sheet4 ), Sheet4[cate] = MAX ( Sheet4[cate] ) ) ) VAR stdev1 = CALCULATE ( STDEV.S ( [c2] ), FILTER ( ALL ( Sheet4 ), Sheet4[cate] = MAX ( Sheet4[cate] ) ) ) RETURN IF ( MAX ( [c1] ) > mean1 + 2 * stdev1, 1, IF ( MAX ( [c1] ) > mean1 + 1 * stdev1, 2, IF ( MAX ( [c1] ) < mean1 - 2 * stdev1, 3, IF ( MAX ( [c1] ) < mean1 - 1 * stdev1, 4, 5 ) ) ) )
First calculate mean and standard deviations based on the same category.
(it detemines on your actual scenario, here it is just an example)
Then calcualte the column you need.
mean = CALCULATE(AVERAGE(Sheet4[c2]),FILTER(Sheet4,Sheet4[cate]=EARLIER(Sheet4[cate]))) STDEV = CALCULATE(STDEV.S([c2]),FILTER(Sheet4,Sheet4[cate]=EARLIER(Sheet4[cate]))) Column = IF ( [c1] > [mean] + 2 * [STDEV], "red", IF ( [c1] > [mean] + 1 * [STDEV], "yellow", IF ( [c1] < [mean] - 2 * [STDEV], "blue", IF ( [c1] < [mean] - 1 * [STDEV], "green", "other" ) ) ) )
Thanks for replying but, that option doesn't seem to work for me.
When I try to do the conditional formatting, it will not let me pick the column if I choose "field value" and it doesn't like the "rules" option either as the column is text. It tries to summarize it by count or first/last.
Create a measure
Measure = VAR mean1 = CALCULATE ( AVERAGE ( Sheet4[c2] ), FILTER ( ALL ( Sheet4 ), Sheet4[cate] = MAX ( Sheet4[cate] ) ) ) VAR stdev1 = CALCULATE ( STDEV.S ( [c2] ), FILTER ( ALL ( Sheet4 ), Sheet4[cate] = MAX ( Sheet4[cate] ) ) ) RETURN IF ( MAX ( [c1] ) > mean1 + 2 * stdev1, 1, IF ( MAX ( [c1] ) > mean1 + 1 * stdev1, 2, IF ( MAX ( [c1] ) < mean1 - 2 * stdev1, 3, IF ( MAX ( [c1] ) < mean1 - 1 * stdev1, 4, 5 ) ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |