Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Experts, please help me to fix the DAX code as it's erroring out SUM cannot work with values of type string.
One of the columns that you are using in the SUM function has a String datatype, which can't be used in the SUM function.
You need to go into your Power Query or Source level and make sure that the columns you are using in your SUM Function are of numeric datatype.
Alternatively, you can also use Value Function to convert strings into Numeric datatype within your DAX.
Flag =
VAR _Cond1 =
IF (
'DW C, S & Comp (2)'[x FD Email Address] <> "FD"
&& (
AVERAGE ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) >= 4
&& AVERAGE ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) <= 7
)
&& SUM ( VALUE('DW C, S & Comp (2)'[Complaint Amount] )) >= 230
&& SUM ( VALUE('DW C, S & Comp (2)'[Comp_OrderID] )) >= 3
&& 'DW C, S & Comp (2)'[Yesterday Flag] = "Y",
"Yes",
"No"
)
VAR _Cond2 =
IF (
'DW C, S & Comp (2)'[x FD Email Address] <> "FD"
&& 'DW C, S & Comp'[Credit % Subtotal] >= 0.24
&& (
SUM ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) >= 8
&& SUM ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) <= 9
)
&& SUM ( VALUE('DW C, S & Comp (2)'[Comp_OrderID]) ) >= 3
&& 'DW C, S & Comp (2)'[Yesterday Flag] = "Y",
"Yes",
"No"
)
VAR _Cond3 =
IF (
'DW C, S & Comp (2)'[x FD Email Address] <> "FD"
&& 'DW C, S & Comp'[Credit % Subtotal] >= 0.22
&& (
SUM ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) >= 10
&& SUM ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) <= 14
)
&& SUM ( VALUE('DW C, S & Comp (2)'[Comp_OrderID]) ) >= 3
&& 'DW C, S & Comp (2)'[Yesterday Flag] = "Y",
"Yes",
"No"
)
VAR _Cond4 =
IF (
'DW C, S & Comp (2)'[x FD Email Address] <> "FD"
&& 'DW C, S & Comp'[Credit % Subtotal] >= 0.2
&& SUM ( VALUE('DW C, S & Comp (2)'[Number Of Orders]) ) >= 15
&& SUM ( VALUE('DW C, S & Comp (2)'[Comp_OrderID]) ) >= 3
&& 'DW C, S & Comp (2)'[Yesterday Flag] = "Y",
"Yes",
"No"
)
RETURN
IF (
_Cond1 = "Yes"
|| _Cond2 = "Yes"
|| _Cond3 = "Yes"
|| _Cond4 = "Yes",
"Yes",
"No"
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 10 |