Forum Discussion

kkalyanrr's avatar
kkalyanrr
Helper V
8 years ago
Solved

Looking up values

Hello Team,   I'm using lookupvalue function to retrieve a value from a different table, and my requirement is little different. Please help me with this.    
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    8 years ago

    Hi kkalyanrr

     

    Try this solution

     

    In your main Table, add a calculated column

     

    Randnumber =
    RANDBETWEEN ( 1, 10000 )

    Now you can do that  LookUp using this Calculated Column

    Sales =
    VAR MaxNumber =
        CALCULATE (
            MAX ( MainTable[Randnumber] ),
            ALLEXCEPT ( MainTable, MainTable[ID] )
        )
    RETURN
        IF (
            MainTable[Randnumber] = MaxNumber,
            LOOKUPVALUE ( SourceTable[Sales], SourceTable[Id], MainTable[ID] )
        )