Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Problems with SUMIF equivalent

Hello,  I am trying to write an equivalent for SUMIF in PowerBI. I am using "less or equal" expression in two cases: with integer and with measure (which contains the same integer). And as a resul...
  • v-xicai's avatar
    6 years ago

    Hi Anonymous ,

     

    You may create measure like DAX below.

     

    Cumul =CALCULATE(SUM(Sheet1[Value]),FILTER(ALLSELECTED(sheet1 ),Sheet1[Product]=MAX(Sheet1[Product]) &&Sheet1[Date] <=MAX(Sheet1[Date] ) ))

     

    For the variable in measure or column  , you may refer to the link: https://radacad.com/caution-when-using-variables-in-dax-and-power-bi.

     

    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.