Forum Discussion

badger007's avatar
badger007
Frequent Visitor
4 years ago
Solved

Conditional sum of a column

Hi guys,

I have a table with dates and column values. Also, I have two measures: one with the third month from today, and a quantity to be applied.

The goal is to apply the quantity, in this case, it's 300, to the sum of values in the product_2 column (it'll always be this column) where the month equals the date_to_apply measure. In the example, the (200 and 200 and 200) from September rows should become 900.

I'm struggling with this operation.

Thanks for your time and help.

 

 

 

  • badger007 

    could you pls provide the sample data ,not the screenshot

    maybe you can try this

    measure= if(max(month)=month(today())+2, sum(product2)+300,sum(product2))

3 Replies

  • badger007 

    could you pls provide the sample data ,not the screenshot

    maybe you can try this

    measure= if(max(month)=month(today())+2, sum(product2)+300,sum(product2))