Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

lookup value bytext in another table

dear forum 

I'm seeking to return 'Svar' number by a text measure in another table. 

The data looks like this: 


I want to find values in response collum when the the textvalue is "Omsætning i t.kr." in the 'finansiel række' collum in the question table.

  preferably it can be made as a measure. 

been trying the lookupfuction: 

Omsætning = LOOKUPVALUE(Response[Svar];Question[Finansiel række];"Omsætning i t.kr.")

does not display anything though. Perhabs because there are duplicates?


Hope someone can help

best regards severin

  • Anonymous Please try this as a measure

     

    TotalResponses = CALCULATE(SUM(MultiLkpTest[Response]),FILTER(ALL(MultiLkpTest),MultiLkpTest[Text]="Test1"))

    Sample DataOutput

  • Anonymous 

     

    TotalResponses = CALCULATE(SUM(Response[ResponseValue]),FILTER(ALL(Question),Question[QuestionName]="Test1"))

    QuestionResponseRelationshipOutput

9 Replies

  • PattemManohar's avatar
    PattemManohar
    Icon for Community Champion rankCommunity Champion

    Anonymous  Are you trying as a calculated column or measure ? Also, if there are multiple responses for that particular question then what you want to do ?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear PattemManohar I'm trying as a measure. If there are multiple responses, which I know there is, I want to sum them all up. Hopefully it's understandable. 

      • PattemManohar's avatar
        PattemManohar
        Icon for Community Champion rankCommunity Champion

        Anonymous Please try this as a measure

         

        TotalResponses = CALCULATE(SUM(MultiLkpTest[Response]),FILTER(ALL(MultiLkpTest),MultiLkpTest[Text]="Test1"))

        Sample DataOutput

  • edhans's avatar
    edhans
    Icon for Community Champion rankCommunity Champion

    LOOKUPVALUE() will return an error if there are multiple records found where the the results column has different values. Your tables also need to be related.

     

    See the documentation with an example. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for reply. My tables are related by ID. There are multiple values in the 'finansiel række' collum  in the question table. 

      • PattemManohar's avatar
        PattemManohar
        Icon for Community Champion rankCommunity Champion
        Please post the sample test data and expected output to understand your requirement in detail