Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Severindj
Frequent Visitor

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: power bi forum 2.JPG
power bi forum.JPG

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

2 ACCEPTED SOLUTIONS

@Severindj Please try this as a measure

 

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

Sample DataSample DataOutputOutput





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

@Severindj 

 

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

QuestionQuestionResponseResponseRelationshipRelationshipOutputOutput





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

9 REPLIES 9
edhans
Super User
Super User

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. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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

Please post the sample test data and expected output to understand your requirement in detail




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Hopefully this makes sense. 

There are probably question dublicates, and therefore I need to sum them all up. they are related through id. 
power bi forum 3.JPG

@Severindj 

 

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

QuestionQuestionResponseResponseRelationshipRelationshipOutputOutput





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




PattemManohar
Community Champion
Community Champion

@Severindj  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 ?





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




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. 

@Severindj Please try this as a measure

 

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

Sample DataSample DataOutputOutput





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




It worked @PattemManohar ! Thank you so much, you're a star!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.