Forum Discussion
graefs
2 years agoFrequent Visitor
Conditional Formatting - Standard Table
Problem: I cannot conditionally format based on two seperate KPIs we have set (See below). Attempted Solutions: -Switch Statements (I have only seen examples with one condition.. example if Type...
- 2 years ago
Hi,
Please try this:Color Format = VAR _Metric = SELECTEDVALUE(T_CondFormat[Metric]) VAR _Value = SELECTEDVALUE(T_CondFormat[Jan]) VAR _Result = SWITCH( TRUE(), _Metric IN {"Quality", "Velocity"} && _Value >=0.98 || _Metric IN {"Utilization"} && _Value >=0.93, "GREEN", _Metric IN {"Quality", "Velocity"} && _Value >=0.975 || _Metric IN {"Utilization"} && _Value >=0.91, "YELLOW", _Metric IN {"Quality", "Velocity"} && _Value < 0.975 || _Metric IN {"Utilization"} && _Value < 0.91, "RED" ) RETURN _Result
Probably you need to create one of this measures for each column with values, but it depends of your data model.Example of the output for column Jan:
_AAndrade
2 years agoResident Rockstar
Hi,
Please try this:
Color Format =
VAR _Metric = SELECTEDVALUE(T_CondFormat[Metric])
VAR _Value = SELECTEDVALUE(T_CondFormat[Jan])
VAR _Result =
SWITCH(
TRUE(),
_Metric IN {"Quality", "Velocity"} && _Value >=0.98 || _Metric IN {"Utilization"} && _Value >=0.93, "GREEN",
_Metric IN {"Quality", "Velocity"} && _Value >=0.975 || _Metric IN {"Utilization"} && _Value >=0.91, "YELLOW",
_Metric IN {"Quality", "Velocity"} && _Value < 0.975 || _Metric IN {"Utilization"} && _Value < 0.91, "RED"
)
RETURN
_Result
Probably you need to create one of this measures for each column with values, but it depends of your data model.
Example of the output for column Jan:
graefs
2 years agoFrequent Visitor
Thank you this works! Not ideal that I will need to create a measure for each column but I will get the result I need!
- _AAndrade2 years agoResident Rockstar
graefs If you change you data model a little bit you will only need one measure.
If you build a table like this:
After you could use a matrix visual like this:And the color format would be this:
Color Format V2 = VAR _Metric = SELECTEDVALUE('T_CondFormat V2'[Metric]) VAR _Value = SUM('T_CondFormat V2'[Value]) VAR _Result = SWITCH( TRUE(), _Metric IN {"Quality", "Velocity"} && _Value >=0.98 || _Metric IN {"Utilization"} && _Value >=0.93, "GREEN", _Metric IN {"Quality", "Velocity"} && _Value >=0.975 || _Metric IN {"Utilization"} && _Value >=0.91, "YELLOW", _Metric IN {"Quality", "Velocity"} && _Value < 0.975 || _Metric IN {"Utilization"} && _Value < 0.91, "RED" ) RETURN _Result