Forum Discussion

Petter120's avatar
Petter120
Helper I
7 years ago

Lookup value based on measure value

Hi im not even sure it this is possible but i give it a try

 

1. If i Have two tables (Table A and Table B)

 

 

2. It i create a table visual whit a date slicer and pick the date 2018-01-01 to 2018-01-05 the visual will display something like this.
(It vill group Name and sum number)

 



3. To the question: Is it possible to from here to lookup value in a table based on the name and number column and display it in the visual table?

 

To claryfi Visuals table is a visual and i realise that lookup value is the same value that is already in the visual, but i think you
get idea.

// Petter

 

 

 

4 Replies

  • i'm not sure but try this

    add column in Table A

    new column = 
    var sumNmbr = sumx(filter(tableA;earier([Name])=[Name]&&earlier([Date])=[Date]);[Number])
    var lookUpB = lookupvalue(tableB[Lookup number];tableB[Name];tableA[Name];tableB[Lookup number];sumNmbr)
    return lookUpB
    • Zubair_Muhammad's avatar
      Zubair_Muhammad
      Community Champion

      Petter120

       

      Try this MEASURE as well

       

      Measure =
      LOOKUPVALUE (
          TableB[Lookup number],
          TableB[Name], SELECTEDVALUE ( TableA[Name] ),
          TableB[Lookup number], SUM ( TableA[Number] )
      )
      

       

       

       

      • Petter120's avatar
        Petter120
        Helper I
        Measure =
        LOOKUPVALUE (
            TableB[Lookup number],
            TableB[Name], SELECTEDVALUE ( TableA[Name] ),
            TableB[Lookup number], SUM ( TableA[Number] )
        )

         

         

        This one works great, but i just realised i was asking the question wrong.

         

        What im trying to figure out is a measure that:

        1. Match the name in Visual table and Table B (Lookup table)

        2. And Match the number Visual table and Table B (Lookup table)

        3. And Returns the corresponding  skop to visual table

         

        Sorry about my ambiguity

         

  • PattemManohar's avatar
    PattemManohar
    Community Champion

    Petter120 Is it something like this you are looking for ?

     

    LkpNumber = LOOKUPVALUE(Test75Lkp[LkpNumber],Test75Lkp[Name],Test75Data[Name],Test75Lkp[LkpNumber],CALCULATE(SUM(Test75Data[Number]),FILTER(Test75Data,Test75Data[Name]=EARLIER(Test75Data[Name]))))