Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to Use multiple selected values and contains string together

I have a Project Table with a column which contains team names with comma seperated values(A,B ; A,B,C ; B,C).  This table is connected via Project ID column to another table "Project Score" . I ...
  • OwenAuger's avatar
    4 years ago

    Hi Anonymous 

     

    As you effectively have a many-to-many relationship between Project and Team, I would recommend creating a bridge table 'Project Team' that contains the combinations of Project ID and Team.

     

    You would then create relationship between Project and 'Project Team' (bidirectional), and between Team and 'Project Team' (single directional).

     

    While it is possible to use CONTAINSSTRING or something similar, it's generally preferable to use physical relationships, for performance reasons as well as avoiding having to write DAX to simulate the relationship.

     

    To give an example, if your Project table looks like this:

    then 'Project Team' would look like this (can be created by taking the Project table and splitting the Team column across rows):

    The data model would look like this:

    Filters on the Team table will propogate via 'Project Team' to Project, and then to 'Project Score'.

     

    Simple PBIX attached.

     

    Regards,

    Owen