Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to do dynamic left anti join?

Hi, 

I want to perform dynamic left anti join in powerbi. I have an erollment table in which i have user's emails and courses in which users are enrolled in and i have second table called users in which i have data of all the users (such as email, name and personal details). Now i want to find the users which are not enrolled in a course and the value should change according to the course i select in a slicer.
So basically, if i select a course in slicer. the user table and enrollment table should perform left anti join and get the emails which are in the users table but are not in enrollment table for that particular course. 

Thanks 

9 Replies

  • Anonymous , Check for use opted for that course. But need a separate usee table for that

     

    Enrolled = countrows(enrollment )

     

    not enrolled =if(isblank(countrows(enrollment ) ) , User[user], blank() )

     

    not enrolled count = countx(values(User[user]),  if(isblank(countrows(enrollment ) ) , User[user], blank() )  )

     

     

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amit, I also need a drill down report to show the users details. Will this approach work then?

    • Anonymous's avatar
      Anonymous
      Not applicable

      There's a separate table but your if statement is not working. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Enrollments (there are many columns which are related to course level)

      EmailCourse Titlestart datestatus
      [email protected]abc9/12/21in progress

       

      users report (contains all the users)

      emailreporting departmentofficejob title
      [email protected]AuditSydneyManager
      [email protected]ITQLDPartner

       

      The logic is if an user is enrolled in any course, the email of that user will be there in enrollment report. If not, then the user is not enrolled. 

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        So if you select abc in the slicer, then in the resultant table, you want the result to be [email protected].  Am i correct?  Share some more rows of data in both tables.  Also, there should be a third table which should list down all courses.  Share that as well.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    Did Ashish_Mathur 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements.

    If that also doesn't help, please share more detailed information to help us clarify your scenario to test.

    How to Get Your Question Answered Quickly 

    Regards,

    Xiaoxin Sheng