Skip to main content
Question

How to make negative amount zero

  • September 10, 2024
  • 1 reply
  • 101 views

Forum|alt.badge.img+1

Hi Team, I have an existing formula for moving average, however I want to add another condition that if the moving average is negative, then the result should be zero.

This is my formula right now:
IF(Actual?,MOVINGAVERAGE('Actual',3),PREVIOUS('Month))

Can you help me how can I add my new condition in this formula? Thank you!

1 reply

sethbradley
Master Trendsetter
Forum|alt.badge.img+8
  • Master Trendsetter
  • September 10, 2024

Hi Suzzy, 

If you don’t want to see the value less than 0, You can add this FILTER at the end of the equation :
IF(Actual?,MOVINGAVERAGE('Actual',3),PREVIOUS('Month))[FILTER : CURRENTVALUE >= 0]
This will filter out all values less or equal to 0.

If you want the values to be 0 instead of blank:
IFBLANK(IF(Actual?,MOVINGAVERAGE('Actual',3),PREVIOUS('Month))[FILTER : CURRENTVALUE >= 0],0)

Let me know if this works for you!

Best,
Seth