Forum Discussion

rdraytonNBRS's avatar
rdraytonNBRS
Frequent Visitor
3 years ago
Solved

Conditional Sum based on Date

Hi All,   I have two fields (one "Revenue" and the other "WeightedAmt"), both of which have a relationship to a MonthEnd date field as per tables below. I want to create a conditional measur...
  • amitchandak's avatar
    3 years ago

    rdraytonNBRS ,

    calculate(sum(Table[Revenue]), filter(Date, Date[Date]<=eomonth(today(),-1) ) )

     

    or

    calculate(sum(Table[Revenue]), filter(all(Date), Date[Date]<=eomonth(today(),-1) ) ) // use allselected if needed

     

    for WeightedAmt 

     

    calculate(sum(Table[WeightedAmt ]), filter(Date, Date[Date]> eomonth(today(),-1) ) )

     

    or

    calculate(sum(Table[WeightedAmt ]), filter(all(Date), Date[Date]> eomonth(today(),-1) ) ) // use allselected if needed