Feb 25 2021 05:45 AM
I'd like to apply conditional formatting to an auto calculated column that needs to display the value as a %. I'd like to highlight values >= 75% and <90% as yellow and values >=90% as red. I'm unfamiliar with JSON and am unable to get the syntax correct. I can get it to highlight the cells correctly but it displays the values as a decimal number and not a %.
Feb 25 2021 07:47 AM
@Walterwhamil72 this can be done as follows. In your calculated column use the following formula:
The formatting of the column is then like this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=[$Percent]*100 + '%'",
"style": {
"color": "=if([$Percent] >= 0.75 , '#ffffff', '#525252'",
"background-color": "= if(([$Percent] >= 0.75 && [$Percent] < 0.90 , '#eebf2d', if(([$Percent] > 0.90, '#730000'), '#ffffff'"
}
}
which gives the following result:
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Feb 25 2021 04:26 PM
@RobElliott Thanks for the guidance. I followed your instructions but the column is now blank. The column names I need in the calculation are:
Cumulative Invoiced/Total Value
The formula I'm using looks like this:
My JSON looks like this:
The Burn Rate column looks like this now:
Walt.
Feb 26 2021 12:15 AM
@Walterwhamil72 the reason it's not working is that in your JSON you've used my column which is called Percent. You've got to use your burn rate column name - as you've got a space in the name check what SharePoint has called it internally in List settings, select the column and check what is after field= in the address bar.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Feb 26 2021 07:24 AM
@RobElliott Everything is working correctly. Thanks for your assistance.