Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Basic Beginners Question. Getting a value from another table into a table

Hi all

I am trying do something simple. 

I have a table with a quantity and I want to multiply it by value per unit to get a total value.

I am trying to pull that value into the table using Lookupvalue

Salesprice = LOOKUPVALUE('Sales Price Per Unit'[$ Sales Price Per Unit], 'Sales Price Per Unit'[ProductId],  1)
I've tried blank and zero
"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."
Am I usingthe wrong function, am I looking up the wrong things?
I know its very basic but I'm confused. I can find lots of questions with more complex setups.
 
 

 

  • Anonymous ,

     

    Try using below measure

     

    Salesprice = LOOKUPVALUE('Sales Price Per Unit'[$ Sales Price Per Unit], 'Sales Price Per Unit'[ProductId], [ProductId])


    TotalValue = [Quantity] * Salesprice

6 Replies

  • Anonymous ,

     

    Try using below measure

     

    Salesprice = LOOKUPVALUE('Sales Price Per Unit'[$ Sales Price Per Unit], 'Sales Price Per Unit'[ProductId], [ProductId])


    TotalValue = [Quantity] * Salesprice

    • Anonymous's avatar
      Anonymous
      Not applicable

      I get a similar error

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Is it because its text in this table?

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    I fixed the table so the column was no longer a text and is now a number and it worked. Thanks again for your help and the Measure