Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX error in PBI

Hi, I am getting an error with this DAX formula:

        Number of NW Accounts = CALCULATE(SUM('Table1'[CustomerName]),'Table2'[Region]="Northwest")

 

The error msg is this:

        "Calculation error in measure: The function SUM cannot work with values of type String"

  • Hi Anonymous ,

     

    You can also use "COUNTROWS",is your issue solved?If so,could you mark the reply as answered to close it?

    Much appreciated.

     

     
     
    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!

6 Replies

  • Correct.  You can't really add up customer names.  What were you trying to achieve?

    • Anonymous's avatar
      Anonymous
      Not applicable

      The number of customers. There is no customer id, so I thought to use the 'Name' field to count the number of customers. Thanks.

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Then you want to swap SUM for COUNT.