8 Replies Latest reply on Jul 19, 2018 6:51 AM by Ana Ana

    Errors in calculated fields

    Ana Ana

      Hello everybody, I have a problem with a formula that I am working on.


      The total budget of a business is provided at the beginning of the month and the sales are at calendar day level. I wish to see in a new column, the sales that were made + how much should the business sale in the remaining days of the month in order to reach the target. The sum of every line should give the original budget.


      I tried this formula but it is not working.


      if [Calendar day]<TODAY() THEN ([Sales])

      ELSE     (IF RUNNING_SUM(SUM([Budget]))>RUNNING_SUM(SUM([Sales]))       

      THEN (RUNNING_SUM(SUM([Budget]))-RUNNING_SUM(SUM([Sales])))/5  END) END


      For now I tried not to complicate the formula with the count of number of days remaining, and I just put it manually. I also attached a quick calculation in excel to show what I expect from the calculated field.

      Here is the link to the workbook: https://public.tableau.com/views/Case2file/Sheet1?:embed=y&:display_count=yes&publish=yes


      Thank you in advance!