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
rflook
Helper II
Helper II

How do I get values from one table, only if there is no matching data in a linked table?

Hopefully this makes sense. 

 

I have a three table model, Details, ParentResponses, and StudentResponses. We have asked parents and students what laptop provision they have at home. We ask the same question to both groups as sometimes parents or students are awful at responding to requests for information, so hopefully we can get a better response rate by combining the two groups. 

 

One of the questions is, what laptop provision doyou have at home (called 'provision' in both ParentResponses and StudentResponses). The Details table contains a list of every student in the school, their unique email address and their parent(s) email address. As a student can have multiple parents, there is a one to many relationship between ParentResponses and Details, and a one to many relationship between StudentResponses and Details. 

 

rflook_1-1593085552019.png

 

 

What I want to do it obtain the student responses to their survey only if the parent has not submitted a response to their survey. Logically something along the lines of: If no parent response in ParentResponses table for this student, check to see if there is a response in the StudentResponses. 

 

Hopefully that all makes sense. How can I do this?

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @rflook 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

As recommended, some sample data and required output is below. 

 

ParentSurvey

ParentEmailAddressProvision
parent1@school.com"No laptop"
parent2@school.com"Mac laptop"
parent3@school.com"Windows 10 laptop"

 

StudentSurvey

ParentEmailAddressProvision
student1@school.com"No laptop"
student2@school.com"Mac laptop"
student4@school.com"Windows 10 laptop, Mac Desktop"

 

Details

ParentEmailAddressStudentEmailAddress
parent1@school.comstudent1@school.com
parent2@school.comstudent2@school.com
parent3@school.comstudent3@school.com
parent4@school.comstudent4@school.com

 

The key thing is that the DAX query needs to look at student4 because their parent (parent4) hasn't respoded to their survey.

 

And the output I would like:

ParentEmailAddressStudentEmailAddressProvision
parent1@school.comstudent1@school.com"No laptop"
parent2@school.comstudent2@school.com"Mac laptop"
parent3@school.comstudent3@school.com"Windows 10 laptop"
parent4@school.comstudent4@school.com"Windows 10 laptop, Mac Desktop"
collinq
Super User
Super User

Hi @rflook ,

 

There is probably some DAX you could do using the filter functions.  But, it might be just as easy to append the tables together and then use a simple set of custom columns where it works something like "if there is a parent response, put a 1 in the column, otherwise 0" and then you select the columns with a 1 in them.  Or you could do somethngn similar by making a measure in one table based on the response in the other table.  And then, use that measure as your criteria.

 

I would appreciate Kudos if my response was helpful. I would also appreciate it if you would Mark this As a Solution if it solved the problem. Thanks!



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

Proud to be a Datanaut!
Private message me for consulting or training needs.




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.