I am looking at formating a number using the following:
formatnumber(float(item()?['Gross Daily']),"[Color 10] 0.00% ▲;[Red] -0.00% ▼")
the formula works fine when I use:
formatnumber(float(item()?['Gross Daily']),'p2') (to return simply a noncolored percent with 2 decimals)
My format above works in excel perfectly and it appears to meet the correct syntax, yet when I try to place it as an expression Power automate tells me it is invalid.
Any thoughts on where I am making a mistake?
Where are you going to store the output? Will it be Excel or a SharePoint list?
If it's going into a SharePoint list then I'd be outputting just the percentage, and use Column Formatting on the List to add the colors and icons, etc.
Hi @Hedgie,
That is the Excel syntax. The formatnumber function in the expression language supports numeric format strings as formats.
Below are the lists for standard and custom numeric format strings which are supported:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings
What you have used in that format is not listed in those two lists.
But you might be able to workaround this by using an if function instead.
if(less(float(item()?['GrossDaily']), 0), concat('Red ', formatnumber(float(item()?['GrossDaily']),'p2'), ' ▼'), concat('Green ', formatnumber(float(item()?['GrossDaily']),'p2'), ' ▲'))