Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

CALCULATE_SUM filter

Hello All, 

 

I have error when i use Calculate , sum filter to get total Score by customer .

 

" The fucntion SUM cannot work with values of type String." error appear when i crate new columun with Dax formula 

"TotalScore by Customer = CALCULATE(SUM(Score ), ALLEXCEPT (Cusotmer)))" 

How should i fix errror ? 

 

Thanks in advance for your help. 

 

Regards, 

SweZin 

 

 

 

5 Replies

  • AntrikshSharma's avatar
    AntrikshSharma
    Icon for Community Champion rankCommunity Champion

    There are 2 errors here, first the data type of Score column is text, you can use power query for that or create a new calculated column using VALUE or do some maths operation on it like multiplyin the column by 1, second you haven't used ALLEXCEPT correctly you need to at least specify 1 column in ALLEXCEPT from which filters will not be removed, otherwise just use ALL ( Customer ).

    • Anonymous's avatar
      Anonymous
      Not applicable

      Actually my dax formula as followed 

      TotalScore = CALCULATE(SUM(Table[Score],ALLEXCEPT(Table,Table[Customer]))