Forum Discussion

Vemul's avatar
Vemul
Helper I
1 year ago
Solved

Gathering Field data from different table of same header fields

Hi Team,

 

new to BI word, would liek to get some help on below item, 

I have two tables with same field names, 

 

need to add Table A filed information into Table B as per dates listed in table - could you please help how to manage 

appreciate your support 

Thanks

V

 

Table A

Line AREACode18-Jul-2525-Jul-252-Aug-25
1CD99AP125131101
2QAB99AP182143
3QAS99AP210
4QAC99AP53

 

 

Table B

Line AREACode18-Jul-2525-Jul-252-Aug-25
24CD99APExpected 125  
25QAB99AP   
26QAS99AP  Expected 0
27QAC99AP   
  • Hi Vemul ,

    Based on my uderstanding i writing the below options,

    1. you can use Reference option, if you would like to get replicate or get all the data from Table A to Table B and the Table B should be automatically updated whenever Table A gets updated,

     

    2. When you have different in Table B and would like to pull data Table A as additional columns then you have to Merge Table A with Table B based on a common column between the two tables.

     

    Please share the expected output in detail if you need to drive any particular result after Merging two tables.

9 Replies

  • Hi,

    Do this in Power Query

    1. Using "Unpivot Other Columns", transform each table into a 5 columnar one - the last 2 columns being attribute and value
    2. Merge Table A into Table B
    3. Pivot back Table B
  • Aburar_123's avatar
    Aburar_123
    Solution Supplier

    Hi Vemul ,

     

    Do you want to replicate table A to table B? Please provide more detail on that

    • Vemul's avatar
      Vemul
      Helper I

      HI Aburar, 

       

      Table A is manual entry and Table B is system driven, it need Table B capture data from Table A when ever it updates baed on date 

      hope this helps 

      V

  • Hi Vemul ,

     

    You can solve this cleanly in Power Query with a few steps:

    1. Unpivot your tables: In Power Query, use “Unpivot Other Columns” on both Table A and Table B, so all your date columns become attribute/value pairs (i.e., you’ll have columns like Line, AREACode, Date, Value).

    2. Merge the tables: Merge Table B with Table A on the relevant keys (Line, AREACode, Date). This will bring in the matching values from Table A to Table B for each date.

    3. Expand and pivot if needed: Expand the merged columns to bring in the values from Table A. If you want your final output in the original wide format, just pivot back by date.

    This method ensures that Table B will always pick up the latest info from Table A for the matching dates and headers no manual editing needed.

     

    If you only need to bring in one specific field and not several, you can also use DAX’s LOOKUPVALUE in a calculated column, but Power Query is much more flexible and scalable for what you described.

     

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi Vemul ,

    Just wanted to check if you were able to resolve the issue and had a chance to go through the suggestions provided by the super users?

  • Aburar_123's avatar
    Aburar_123
    Solution Supplier

    Hi Vemul ,

    Based on my uderstanding i writing the below options,

    1. you can use Reference option, if you would like to get replicate or get all the data from Table A to Table B and the Table B should be automatically updated whenever Table A gets updated,

     

    2. When you have different in Table B and would like to pull data Table A as additional columns then you have to Merge Table A with Table B based on a common column between the two tables.

     

    Please share the expected output in detail if you need to drive any particular result after Merging two tables.

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi @Vemul ,

    Just wanted to check if you were able to resolve the issue and had a chance to go through the suggestions provided by the super users? If you need any assistance , let us know.

    Thank you

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi Vemul ,

    Since we didnt hear back, we would be closing this thread.
    If you need any assistance, feel free to reach out by creating a new post.

    Thank you