Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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 'A' then "Green")
-Rules (IF Jan >= 98% and <= 100% then Green)
The only solution I can think of is to create a seperate table for Utilization.
Metric Definitions:
Quality/Velocity:
Utilization:
Desired Result:
Metric | Type | Jan | Feb |
Quality | A | 98.0% | 90.5% |
Quality | B | 99.0% | 98.3% |
Quality | C | 97.7% | 96.2% |
Velocity | A | 94.6% | 99.1% |
Velocity | B | 100.0% | 93.9% |
Velocity | C | 99.0% | 100.0% |
Utilization | A | 94.8% | 88.5% |
Utilization | B | 90.9% | 95.0% |
Utilization | C | 92.1% | 91.9% |
Solved! Go to Solution.
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:
Proud to be a Super User!
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:
Proud to be a Super User!
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!
@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
Proud to be a Super User!
Hello,
My suggestion would be to create a measure that calculates the color you would like to display and use that as your conditional formatting field, instead of rules.
In the measure you can have an if statement that goes like this
Color of Text = If(Metric="Utilization",If(Value>=.93,"Green",If(Value<=91,"Red",(If(So on and so forth with nested If's)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
93 | |
87 | |
80 | |
69 | |
68 |
User | Count |
---|---|
226 | |
129 | |
119 | |
83 | |
77 |