Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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 

 

 

 

1 ACCEPTED SOLUTION

Change it to Integer. SUM won't work on text data.

View solution in original post

5 REPLIES 5
AntrikshSharma
Community Champion
Community 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
Not applicable

Actually my dax formula as followed 

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

 

 

What is the data type of column Score?
Anonymous
Not applicable

The data type is Text 

Change it to Integer. SUM won't work on text data.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.