Forum Discussion

cretak's avatar
cretak
Frequent Visitor
1 year ago
Solved

Create new column based on multiple conditions from a related table

Hi all,

 

I am currenlty learing PowerBI and also attending training classes. Therefore, coming across more and more use cases. One of which I struggle right now on how to solve it. I hope someone can provide some help with:

 

I have two tables. A project table and a project member table. They are connected via the project id. Would like to have the name of the project manager in the project table as a new column. 

 

Project Table:

project idname
1Implementation
2Marketing

 

Project Member

project idnameroleisLead
1JohnScrum LeadNo
1MelissaProject ManagerYes
1SamProject ManagerNo
2JeffProject ManagerYes

 

Expected Outcome

project idnameproject manager
1ImplementationMelissa
2MarketingJeff

 

Does anyone know how to solve this? Any help is highly appreciated!

 

Thanks Oli

  • Hi cretak , add this as Custom Column in Project Table:

     

    Table.SelectRows(#"Project Member", (x)=> x[isLead] = "Yes" and x[project id] = [project id]){0}?[name]?

3 Replies

  • dufoq3's avatar
    dufoq3
    Icon for Community Champion rankCommunity Champion

    Hi cretak , add this as Custom Column in Project Table:

     

    Table.SelectRows(#"Project Member", (x)=> x[isLead] = "Yes" and x[project id] = [project id]){0}?[name]?
  • cretak's avatar
    cretak
    Frequent Visitor

    Hi dufoq3 ,

     

    many thanks! Appreciate your help! It worked like a charm

    • dufoq3's avatar
      dufoq3
      Icon for Community Champion rankCommunity Champion

      You're welcome. Enjoy 😉