Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Sum with filter by ID

 

Hello,

 

In power bi ,I would like when the line code is 1 and it is also 4 > I would like to make the sum of the numbers of the J column corresponding to this selection.

 

How calculate this in DAX plz ? 

i try calculate(sum with filter but my result is empty if i try with many filters.

 

Thank for help

 

 

 

  • Anonymous ,which column has value 1 and which one has 4.

     

    You can have measure like one of the two, use correct column names

     

    calculate(sum(Table[J]) , filter(Table, Table [I] in {1,4}))

     

    or

     

    calculate(sum(Table[J]) , filter(Table, Table [I] = 1 && Table[G] = 4))

2 Replies

  • Anonymous ,which column has value 1 and which one has 4.

     

    You can have measure like one of the two, use correct column names

     

    calculate(sum(Table[J]) , filter(Table, Table [I] in {1,4}))

     

    or

     

    calculate(sum(Table[J]) , filter(Table, Table [I] = 1 && Table[G] = 4))

    • Anonymous's avatar
      Anonymous
      Not applicable

      This calculate(sum(Table[J]) , filter(Table, Table [I] in {1,4}))   <== works perfectly

      but

      this calculate(sum(Table[J]) , filter(Table, Table [I] = 1 && Table[G] = 4))  NOT working..