Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Add a Column in a table to another table

Hi,

How to add a column "Week No." which is in 'Table A' to the columns in Table B

  • Anonymous 

    Ensure both Table A and Table B have a common column

    Go to the Model view in Power BI, and drag the common column from Table A to Table B to create a relationship.

    Create a new column in Table B

    Week No. = RELATED('Table A'[Week No.])

    πŸ’Œ If this helped, a Kudos πŸ‘ or Solution mark would be great! πŸŽ‰
    Cheers,
    Kedar
    Connect on LinkedIn

3 Replies

  • You can achieve this via Power Query

    Go to Power Query Editor -> PQE Home -> Merge Queries -> Left join

  • Hi Anonymous - Ensure that there is a common column (a key) between Table A and Table B to make the merge successful. Without a common key, Power BI will not be able to match rows between the two tables.

    In PQ editor you can use merge query and join Left Outer Join ensures all rows from Table B are kept, with matching "Week No." values added from Table A.

     

    Hope this helps.

  • Anonymous 

    Ensure both Table A and Table B have a common column

    Go to the Model view in Power BI, and drag the common column from Table A to Table B to create a relationship.

    Create a new column in Table B

    Week No. = RELATED('Table A'[Week No.])

    πŸ’Œ If this helped, a Kudos πŸ‘ or Solution mark would be great! πŸŽ‰
    Cheers,
    Kedar
    Connect on LinkedIn