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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tmears
Helper III
Helper III

SQL left Join

Hi everyone

I would if anyone could give me some pointers as struggling a bit.  My SQL query knowledge is not great.  I need to tranlate this into DAX.  and doing my research but goig around in circles a bit!!

 

the SQL query is:

 

select personview.forename, personview.surname,
wlocation.dateanswervalue as "Expiry Date from Last Carer Monitoring",
personOrgRelationshipView.organisationname as "Scheme",

publia.answervalue as "Expiry Date from Pre-Placement Checklist",

personview.personid
from personview

left join formanswerpersonview wlocation
on personview.personid=wlocation.answerforsubjectid
and designguid ='f98ab2f7-7010-4c93-b9de-2801066ccda8'
And controlname='certificateExpiryDate'
and instancestate='COMPLETE'
and wlocation.instanceid= (
select max (x.instanceid)
from formanswerpersonview x
where x.answerforsubjectid = wlocation.answerforsubjectid
and x.designguid = wlocation.designguid
and x.instancestate='COMPLETE'
)

left join formanswerpersonview publia
on personview.personid=publia.answerforsubjectid
and publia.designguid ='3f6d7b80-e1b6-4286-b6a9-803fc569706b'
And publia.controlname='date_21'
and publia.instancestate='COMPLETE'
and publia.instanceid= (
select max (x.instanceid)
from formanswerpersonview x
where x.answerforsubjectid = publia.answerforsubjectid
and x.designguid = publia.designguid
and x.instancestate='COMPLETE'
)
INNER join personOrgRelationshipView
on personview.personid=personOrgRelationshipView.personid

inner join classificationPersonView places
on places.personid=personview.personid
wHERE code='APP'
And status='ACTIVE'
AND endDate IS NULL

order by forename

 

Clearly the inner joins are fine but it is the left join i am unclear on?  any help would be greatly appriciated, as i continue to research

 

Many thanks 

 

Tim 

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @tmears ,

 

Please provide the sample tables and expected output, I will help you achieve it using DAX.

 

Best regards,
Lionel Chen

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

lbendlin
Super User
Super User

it's actually the other way around.  For the sake of your argument Power BI always does a left join by default*, it's the inner join that you need to work for.

 

* What actually happens is much more complex, based on the concept of expanded tables, with a sprinkling of Auto Exist .

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors