Forum Discussion
Display negative value in a column if a condition is meet in another column
Hello all,
Can you please help me? I have 1 column named Sales Activity that has several selection options and the other column MF/Line (ALL). When the user select in the Sales Activiy the condition Disconnecion the value in M.fee tab to be negative.
Thank you!
Elona105 so if this is your list and the monthly fee column is not formatted it looks like this:
But if you format the column in advanced mode with the following JSON...
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=if([$SalesActivity] == 'Disconnect', @currentField * -1, @currentField)" }
...then change one of the selections in the Sales Activity column to Disconnect the result looks like this:
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
3 Replies
- Elona105Copper ContributorPls can someone help me?
- Rob_ElliottBronze Contributor
Elona105 so if this is your list and the monthly fee column is not formatted it looks like this:
But if you format the column in advanced mode with the following JSON...
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=if([$SalesActivity] == 'Disconnect', @currentField * -1, @currentField)" }
...then change one of the selections in the Sales Activity column to Disconnect the result looks like this:
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)- Elona105Copper Contributor
Thank you very much Rob_Elliott (microsoft.com). You helped me a lot 🙂