cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
harirao
Post Partisan
Post Partisan

Function 'LOOKUPVALUE' does not support comparing values of type Number with values of type Text. Co

Hi All,

I'm creating a new column in a Main table as LOOKUPVALUE "Product Column in text format".
In cost Table "Part No Column in text format" & '"Total Colum in INTEGER format".
The following format example:

C3.PNG
Below is a DAX column created, where I am getting an error
"Function 'LOOKUPVALUE' does not support comparing values of type Number with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."

C1.PNG

 

TEST! = LOOKUPVALUE(
    Icost[Part No.],
         Icost[Total],
             FORMAT(PATHITEM ('Main Table'[Product],1,0), "NA"))

Help me to fix this issue.
 
Thank you
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@harirao , The first one is the return value.

 

I think you need like

 

maxx(filter( Icost, Icost[Part No.] = FORMAT(PATHITEM ('Main Table'[Product],1,0), "NA")), Icost[Total])

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@harirao , The first one is the return value.

 

I think you need like

 

maxx(filter( Icost, Icost[Part No.] = FORMAT(PATHITEM ('Main Table'[Product],1,0), "NA")), Icost[Total])

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors