Forum Discussion
JohnF5343
4 years agoRegular Visitor
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 ...
- 4 years ago
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
4 years agoHow did you get on with the link I posted above?
JohnF5343
4 years agoRegular 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 ),"")
)
- HotChilli4 years ago
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.
- JohnF53434 years agoRegular Visitor
Ok, all good.
Org 1 Email = LOOKUPVALUE ( resources_cntrl[email], resources_cntrl[number], PATHITEM (resources_cntrl[OrgH], 1, 0 ) )Used a zero instead.