Forum Discussion
Function 'LOOKUPVALUE' does not support comparing values of type Text with values of type Integer.
Hi,
I'm creating a new column in a table with following DAX. All the columns in the DAX are text. The number column has the following format example: TWD123, SalesOrgH has the following format example: RTW001|WDC001|ERD001|EDG001.
Org 1 Email =
LOOKUPVALUE (
'Test'[email],
'Test'[number], PATHITEM ( Test[SalesOrgH], 1, 1 )
)I'm getting the following error: Function 'LOOKUPVALUE' does not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
I've tried changing the number column to a number but I get an error.
How can I solve this one?
Thanks for the help.
https://docs.microsoft.com/en-us/dax/pathitem-function-dax?WT.mc_id=DP-MVP-4025372#parameters
Please look at the 3rd parameter
8 Replies
- HotChilli
Community Champion
https://docs.microsoft.com/en-us/dax/pathitem-function-dax?WT.mc_id=DP-MVP-4025372#parameters
Please look at the 3rd parameter
- HotChilli
Community Champion
Test[number] is a Text type, so the PATHITEM has to return text. The 3rd parameter defines the type returned so please look at that.
- JohnF5343Regular Visitor
Hi, they are all text fields. What should I do? Thanks.
- HotChilli
Community Champion
How did you get on with the link I posted above?
- JohnF5343Regular Visitor
Not very far. 🙂
I tried the following but still get an error.
Org 1 Email = LOOKUPVALUE ( 'Table'[EmployeeEmail], 'Table'[EmployeeID], FORMAT( PATHITEM ( 'Table'[OrgH], 1, 1 ),"") )- HotChilli
Community Champion
Why are you trying to use FORMAT? The 3rd parameter of PATHITEM defines the return type.
"If missing or TEXT or 0 then this function returns a string. If INTEGER or 1 then this function returns an integer."
The LOOKUPVALUE that doesn't work is using PATHITEM with a 1 in the 3rd parameter. Try the other option.