Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I need help with conditional formating within one cell. The below example highlighted is whoat I would like to format. I need it to be able to compare between Crtical, High, Medium, and Low then take the highest value (being Critical) and removing the rest. Any suggestions?
Solved! Go to Solution.
HI -
Here is a possible solution in "M". This assumes your table is called "Data", and will generate a new table called "NewTable"
let
NewTable = Table.AddColumn(Data, "NewColumn",
each
if Text.Contains( [Severity], "Critical") then "Critical"
else
if Text.Contains( [Severity], "High") then "High"
else
if Text.Contains( [Severity], "Medium") then "Medium"
else
"None")
in
NewTable
It uses the Table.AddColumn function. This requires a table (called in the case "Data") a column name (called "NewColumn", you can call it what you want) and then a function. The "each" keyword acts as an iterator, passing the column called "Severity" through nested if-clauses to return only a single value.
Hope this helps!
Peter
HI -
Here is a possible solution in "M". This assumes your table is called "Data", and will generate a new table called "NewTable"
let
NewTable = Table.AddColumn(Data, "NewColumn",
each
if Text.Contains( [Severity], "Critical") then "Critical"
else
if Text.Contains( [Severity], "High") then "High"
else
if Text.Contains( [Severity], "Medium") then "Medium"
else
"None")
in
NewTable
It uses the Table.AddColumn function. This requires a table (called in the case "Data") a column name (called "NewColumn", you can call it what you want) and then a function. The "each" keyword acts as an iterator, passing the column called "Severity" through nested if-clauses to return only a single value.
Hope this helps!
Peter
It worked perfectly. Thank you
Here is a pic of the result. I realized that I did no include an option for "low", you will need to add that yourself as an option at the end of the if clause.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 16 | |
| 14 | |
| 12 | |
| 7 | |
| 6 |