The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
Im trying to apply logic into matrix but based on different rule for almost each cell in a row.
I'm using currently only one measure to give me percentage result.
What i have so far:
What the result of formatting should look like:
Appreciate your help, Dan 🙂
Solved! Go to Solution.
Hi @Daniel_Derbin,
For this you need to create a metric similar to this:
Formating =
SWITCH (
TRUE (),
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Critical"
&& [% of vuln wo Sev] >= 0.92, "Green",
SELECTEDVALUE ( Table[Record age] ) = "31-60 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Critical"
&& [% of vuln wo Sev] <= 0.08
&& [% of vuln wo Sev] > 0, "Yellow",
(
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
|| SELECTEDVALUE ( Table[Record age] ) = "31-61 days"
)
&& SELECTEDVALUE ( Table[Severity] ) = "High"
&& [% of vuln wo Sev] >= 0.95, "Green",
SELECTEDVALUE ( Table[Record age] ) = "61-90 days"
&& SELECTEDVALUE ( Table[Severity] ) = "High"
&& [% of vuln wo Sev] <= 0.05
&& [% of vuln wo Sev] > 0, "Yellow",
(
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
|| SELECTEDVALUE ( Table[Record age] ) = "31-61 days"
|| SELECTEDVALUE ( Table[Record age] ) = "61-90 days"
)
&& SELECTEDVALUE ( Table[Severity] ) = "Medium"
&& [% of vuln wo Sev] >= 0.95, "Green",
SELECTEDVALUE ( Table[Record age] ) = "91-180 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Medium"
&& [% of vuln wo Sev] <= 0.05
&& [% of vuln wo Sev] > 0, "Yellow",
(
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
|| SELECTEDVALUE ( Table[Record age] ) = "31-61 days"
|| SELECTEDVALUE ( Table[Record age] ) = "61-90 days"
|| SELECTEDVALUE ( Table[Record age] ) = "91-180 days"
)
&& SELECTEDVALUE ( Table[Severity] ) = "Low"
&& [% of vuln wo Sev] >= 0.95, "Green",
SELECTEDVALUE ( Table[Record age] ) = "180-360 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Low"
&& [% of vuln wo Sev] <= 0.05
&& [% of vuln wo Sev] > 0, "Yellow",
"Red"
)
This may need some adjustments, there is also an option to create a table with the values of your maximum and minimun values if you want I can try and setup that table that would allow you to give you a better editing option in the future.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Daniel_Derbin,
For this you need to create a metric similar to this:
Formating =
SWITCH (
TRUE (),
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Critical"
&& [% of vuln wo Sev] >= 0.92, "Green",
SELECTEDVALUE ( Table[Record age] ) = "31-60 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Critical"
&& [% of vuln wo Sev] <= 0.08
&& [% of vuln wo Sev] > 0, "Yellow",
(
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
|| SELECTEDVALUE ( Table[Record age] ) = "31-61 days"
)
&& SELECTEDVALUE ( Table[Severity] ) = "High"
&& [% of vuln wo Sev] >= 0.95, "Green",
SELECTEDVALUE ( Table[Record age] ) = "61-90 days"
&& SELECTEDVALUE ( Table[Severity] ) = "High"
&& [% of vuln wo Sev] <= 0.05
&& [% of vuln wo Sev] > 0, "Yellow",
(
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
|| SELECTEDVALUE ( Table[Record age] ) = "31-61 days"
|| SELECTEDVALUE ( Table[Record age] ) = "61-90 days"
)
&& SELECTEDVALUE ( Table[Severity] ) = "Medium"
&& [% of vuln wo Sev] >= 0.95, "Green",
SELECTEDVALUE ( Table[Record age] ) = "91-180 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Medium"
&& [% of vuln wo Sev] <= 0.05
&& [% of vuln wo Sev] > 0, "Yellow",
(
SELECTEDVALUE ( Table[Record age] ) = "0-30 days"
|| SELECTEDVALUE ( Table[Record age] ) = "31-61 days"
|| SELECTEDVALUE ( Table[Record age] ) = "61-90 days"
|| SELECTEDVALUE ( Table[Record age] ) = "91-180 days"
)
&& SELECTEDVALUE ( Table[Severity] ) = "Low"
&& [% of vuln wo Sev] >= 0.95, "Green",
SELECTEDVALUE ( Table[Record age] ) = "180-360 days"
&& SELECTEDVALUE ( Table[Severity] ) = "Low"
&& [% of vuln wo Sev] <= 0.05
&& [% of vuln wo Sev] > 0, "Yellow",
"Red"
)
This may need some adjustments, there is also an option to create a table with the values of your maximum and minimun values if you want I can try and setup that table that would allow you to give you a better editing option in the future.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi MFelix,
That worked as a charm after smal adjustments.
Thank you a lot!! 🙂
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 August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
80 | |
80 | |
48 | |
40 |
User | Count |
---|---|
150 | |
110 | |
64 | |
64 | |
58 |