Forum Discussion
Conditional formatting with filters
- 7 years ago
Hi, try with this:
A measure to apply the color :
Color = VAR _Sales = SUM ( Sales[Sales] ) VAR _Group = SELECTEDVALUE ( Sales[Group] ) RETURN SWITCH ( _Group, "Group 1", SWITCH ( TRUE (), _Sales <= 0,18, "#ff0000", _Sales < 0,21, "#ffa500", "#00ff00" ), "Group 2", SWITCH ( TRUE (), _Sales <= 0,14, "#ff0000", _Sales < 0,18, "#ffa500", "#00ff00" ), "Group 3", SWITCH ( TRUE (), _Sales <= 0,24, "#ff0000", _Sales < 0,28, "#ffa500", "#00ff00" ) )Note: You can improve this if work with a table and the range color by each group.
Finally , in conditional format Select Format by Field Value and choose the measure (In this case Color)
Ready
Victor
Hi,
How can I use the measure as a Conditional formatting,
Like Zone 1 = MinObj: 30%
Obj: %35
Zone2 = MinObj: 38%
Obj: 45%
Thanks!
Here is how I approached it. I created a measure "Status" and based the conditional formatting on that measure. I will reverse engineering it for you here:
Status = //Look for the highest delta that is > 0, assign status as appropriate
IF (
[Uptime Delta Max] < 0,
IF ( [Uptime Delta Tar] < 0, IF ( [Uptime Delta Th] < 0, 0, 1 ), 2 ),
3
)
Uptime Delta Max = //Calculate the difference between the display value and a different set value
CALCULATE (
[Total Uptime %] - MIN ( 'Application'[Total SLA Max] )
)
Uptime Delta Tar =
CALCULATE (
[Total Uptime %] - MIN ( 'Application'[Total SLA Target] )
)
Uptime Delta Th =
CALCULATE(
[Total Uptime %] - MIN( 'Application'[Total SLA Threshold] )
)
The measure/value that you are displaying would be the equivalent of my "Total Uptime %". Each application has a different SLA Max, Target and Threshold, and this information is in its own table in the data model.
Hope this helps
David