Forum Discussion

smccres's avatar
smccres
Frequent Visitor
2 years ago
Solved

Cross information between 3 tables

In power BI desktop I am looking forward to have a "Training Matrix" table with Can Execute / Cannot Execute certification status, as below:     UserName   Operation   Certification Status ...
  • barritown's avatar
    2 years ago

    Hi smccres,

    Assuming that all three tables are not related, I could propose such a calculated column:

    And in plain text:

    Certification Status = 
    VAR _curtUser = [UserName]
    VAR _curOperation = [Operation]
    VAR _tbl1 = SELECTCOLUMNS ( FILTER ( OperationCertRequirement, [Operation] = _curOperation ), "Value1", [Certificate_Needed] )
    VAR _tbl2 = SELECTCOLUMNS ( FILTER ( UserCertification, [User] = _curtUser && [Status] = "Active" ), "Value2", [Certificate] )
    VAR _res = ADDCOLUMNS ( _tbl1, "Flag", INT ( NOT [Value1] IN _tbl2 ) )
    RETURN IF ( SUMX ( _res, [Flag] ) > 0, "Cannot Execute", "Can Execute" )

    Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian