Forum Discussion

stevengaris's avatar
stevengaris
Frequent Visitor
6 years ago
Solved

If statement not working properly.

I have a measure that is calculating a moving average of deliveries which seems to work fine.   

 

I then made a new column with an if statement to compare the daily delivery count against the calculated moving average and mark it either above or below the moving average result. 

 

However, it doesn't seem to be working correctly....  The days 1/7-1/9 are above the average of 12.52 but are saying Below. 

  • you created a calculated column right? The row context is not propagated to the filter context, meaning you might compare it with the running average of not only houston...

     

    What you can do: create a new calculated column with the measure in it, so you can see what your above / below formula is comparing against.

4 Replies

  • you created a calculated column right? The row context is not propagated to the filter context, meaning you might compare it with the running average of not only houston...

     

    What you can do: create a new calculated column with the measure in it, so you can see what your above / below formula is comparing against.

    • stevengaris's avatar
      stevengaris
      Frequent Visitor

      It only says Below for all rows.

       

      I have a date table and it is linked in the model view I believe. 

       

      This is what it looks like...

       

      How would I incorporate it to help solve this problem? 

      • v-xicai's avatar
        v-xicai
        Community Support

        Hi stevengaris ,

         

        You may create the "Above/Below" using measure instead of calculated column.

         

        Best Regards,

        Amy

         

        Community Support Team _ Amy

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.