Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Combine data from two tables into two different columns

Hi,

 

I want to create two measures that i can drag into a table visual against a common column.

 

The data is as following

Table 1:

 

Table 2

 

Final Desired Table- I wish to drag contact_id from Table 1 and the two measures to give following

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Please refer to my pbix file to see if it helps you.

    The first way:
    Using Tahreem24 's method: Create relationship

    Another way: Do not need to create relationships. 

    Create a measure:

    Measure =
    CALCULATE (
        MAX ( 'Table'[Segment] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[CONTACT_ID] = SELECTEDVALUE ( Table_1[contact_id] )
        )
    )
    

    Best Regards

    Community Support Team _ Polly

     

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

     

     

     

     

2 Replies

  • Anonymous You need to have a relationship between these two tables based on common key (let's say Contact_ID) then you can drag them all together.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please refer to my pbix file to see if it helps you.

    The first way:
    Using Tahreem24 's method: Create relationship

    Another way: Do not need to create relationships. 

    Create a measure:

    Measure =
    CALCULATE (
        MAX ( 'Table'[Segment] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[CONTACT_ID] = SELECTEDVALUE ( Table_1[contact_id] )
        )
    )
    

    Best Regards

    Community Support Team _ Polly

     

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