Chasity
Chasity

Reputation: 27

DAX error with type text values - Pay Terms

Team,

I get the DAX comparison operations do not support comparing values of type text with values of type integer error when using this formula:

Z - Term Type = if('Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms]=0,"",if('Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms]=30,"Net 30",if('Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms]=45,"Net 45")))

I tried adding 'value' and couldn't get it to work. Any ideas on what I'm doing wrong?

Thanks so much,

Upvotes: 0

Views: 113

Answers (1)

smpa01
smpa01

Reputation: 4282

The error is occuring as 'Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms] has data types STRING. Please make sure that you change the data type, so that expression can make the comparison.

Z - Term Type =
IF (
    'Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms] = 0,
    "",
    IF (
        'Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms] = 30,
        "Net 30",
        IF (
            'Sage_SQL_AR_InvoiceHistoryHeader_CAN+US_Combined'[Z -Inv. Pay Terms] = 45,
            "Net 45"
        )
    )
)

Upvotes: 1

Related Questions