Forum Discussion

Richard_Halsall's avatar
2 years ago
Solved

Identify Employees with Multiple Certificates using disconnected table slicer

Hi

 

My data is structured as follows

Employee

idfirstnamelastname
1234abcdefg
5678hijklmno

 

Certificate Group

 

Group NameCertificate Name
GroupACertA
GroupACertB
GroupACertC
GroupBCertC
GroupBCertD
GroupBCertF
GroupBCertZ

 

Certificates Held

 

EmployeeidcertificateName
1234CertA
1234CertB
1234CertC
1234CertF
1234CertZ
5678CertA
5678CertB
5678CertC
5678CertD
5678CertF
5678CertZ

 

I need to select a certificate group, prefereably using a disconnected table slicer, and have a table visual returned of all employees who have ALL the certificates specified in the Certificate Group Table

 

So in the above example selecting

 

Certificate Group 'GroupA' would show employees 1234 and 5678

Certificate Group 'GroupB' would show employee 5678

Any advice would be appreciated. Thanks

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,

    Thanks for the solution amitchandak  provided, your soution is excellent, and i want to offer some more information for user to refer to.

    hello Richard_Halsall , based on your description, you can create a relatiohip between your emplyee table and your Certificates Held table.

    Then you can create a meaure.

     

    Flag =
    VAR a =
        VALUES ( 'Certificate Group'[Certificate Name] )
    VAR b =
        CALCULATE (
            COUNTA ( 'Certificates Held'[Employeeid] ),
            'Certificates Held'[certificateName] IN a
        )
    RETURN
        IF (
            ISFILTERED ( 'Certificate Group'[Group Name] ),
            IF ( COUNTROWS ( a ) = b, 1 ),
            1
        )
    

     

    Then put the measure and id of employee table to the table visual.

    Output

     

    Best Regards!

    Yolo Zhu

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

     

5 Replies

  • Richard_Halsall , Table 2 and three should be disconnected

     

    measure =
    var _tab = Values('Certificate Group'[Certificate Name])
    var _cnt = countrows(_tab)
    return
    Countx( summarize(Filter('Certificates Held', Certificates Held[certificateName] in _tab), 'Certificates Held'[Employeeid], "_actual", distinctcount( Certificates Held[certificateName])), if([_actual] =_cnt, [Employeeid], blank()))

     

    plot this with employee id of table 3 or with 1(If joined with 3)

    • Richard_Halsall's avatar
      Richard_Halsall
      Icon for Helper IV rankHelper IV

      amitchandak Hi, thanks for the swift repsonse the measure you have provided does work but when used on the table 'Certificates Held'  approx. 46k records I am experiencing performance issues - is there anyway to optimise. Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    Thanks for the solution amitchandak  provided, your soution is excellent, and i want to offer some more information for user to refer to.

    hello Richard_Halsall , based on your description, you can create a relatiohip between your emplyee table and your Certificates Held table.

    Then you can create a meaure.

     

    Flag =
    VAR a =
        VALUES ( 'Certificate Group'[Certificate Name] )
    VAR b =
        CALCULATE (
            COUNTA ( 'Certificates Held'[Employeeid] ),
            'Certificates Held'[certificateName] IN a
        )
    RETURN
        IF (
            ISFILTERED ( 'Certificate Group'[Group Name] ),
            IF ( COUNTROWS ( a ) = b, 1 ),
            1
        )
    

     

    Then put the measure and id of employee table to the table visual.

    Output

     

    Best Regards!

    Yolo Zhu

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

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    Thanks for the solution amitchandak  provided, your soution is excellent, and i want to offer some more information for user to refer to.

    hello Richard_Halsall , based on your description, you can create a relatiohip between youe emplyee table and your Certificates Held table.

    Then you can create a meaure.

    Flag =
    VAR a =
        VALUES ( 'Certificate Group'[Certificate Name] )
    VAR b =
        CALCULATE (
            COUNTA ( 'Certificates Held'[Employeeid] ),
            'Certificates Held'[certificateName] IN a
        )
    RETURN
        IF (
            ISFILTERED ( 'Certificate Group'[Group Name] ),
            IF ( COUNTROWS ( a ) = b, 1 ),
            1
        )
    

    Then put the measure and id of employee table to the table visual.

    Output

     

    Best Regards!

    Yolo Zhu

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