Forum Discussion
hibarrbm
6 years agoHelper I
Token Comma Expected Error
Hi, I'm receiving the "Token Comma Expected" error for script below. = CALCULATE ( VAR TotalSalePrice = CALCULATE ( SUMX ( 'ODS_OWNER FACT_ORDER_LINE', IF ( 'ODS_OWNER FACT_ORDER_LINE'[ORDER_...
hibarrbm
6 years agoHelper I
Apologizes, this is the second filter that needs to be applied. Once i updated the formula it gave me the following error message:
Test Sales New = CALCULATE (
0 + SUM ( 'FACT_ORDER_LINE'[TOTAL_SALE_PRICE] ),
KEEPFILTERS ( 'FACT_ORDER_LINE'[ORDER_STATUS_KEY] <> {27,22,20,18,23,19,-2,109,110}),
KEEPFILTERS ( 'FACT_ORDER_LINE'[ORDER_LINE_FLG] <> 1 )
)
Anonymous
6 years agoNot applicable
You can't write
'FACT_ORDER_LINE'[ORDER_STATUS_KEY] <> {27,22,20,18,23,19,-2,109,110}
since the LHS is a scalar and the RHS is a set. When you compare objects they must be of the same type.
The correct condition is
NOT 'FACT_ORDER_LINE'[ORDER_STATUS_KEY] IN {27,22,20,18,23,19,-2,109,110}
'FACT_ORDER_LINE'[ORDER_STATUS_KEY] <> {27,22,20,18,23,19,-2,109,110}
since the LHS is a scalar and the RHS is a set. When you compare objects they must be of the same type.
The correct condition is
NOT 'FACT_ORDER_LINE'[ORDER_STATUS_KEY] IN {27,22,20,18,23,19,-2,109,110}