Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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"
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
12 | |
11 | |
9 | |
9 | |
8 |