Forum Discussion

BIswajit_Das's avatar
BIswajit_Das
Impactful Individual
3 years ago
Solved

Power bi Calculated table

There are two table i.e

table1

areanumber
1909
2908
3907
6897
4876
5878

and table2

areanumber
9441
10232
53423
2233
111213
12234

required calculated table is

areanumber
1909
2233
3907
6897
4876
53423
9441
10232
111213
12234

update the old data(table1) with the new data(table2) on power bi desktop

Thank & regrads
Biswajit

  • Found a solution :-

    Z_TABLE =
    VAR _old =
    FILTER (
    'table1',
    'table1'[AC_NO - Copy]
    <>CALCULATE (
    SELECTEDVALUE('table2'[AC_NO - Copy]),
    ALLEXCEPT (
    'table1','table1'[AC_NO - Copy]
    )
    )
    )
    VAR _new = 'table2'
    RETURN
    UNION(_old,_new)

7 Replies

  • Hi.

    You should go to power query / transform

    Then select APPEND QUERIES

    and choose this way in picture

    • BIswajit_Das's avatar
      BIswajit_Das
      Impactful Individual

      But appending both tables cause duplicates entries of both tables

  • Just Append both the tables in Power Query it will resolve your problem

  • BIswajit_Das's avatar
    BIswajit_Das
    Impactful Individual

    Thank you for responding but

    isn't appending both table combines all the records old+new

     

    • mrcss23's avatar
      mrcss23
      Advocate IV

      After the suggested step, the table 1 will have added all the record of table 2.

      You you then use table 1 because it will have the full records.

  • BIswajit_Das's avatar
    BIswajit_Das
    Impactful Individual

    I just need to take the recent records based on area not all the

  • BIswajit_Das's avatar
    BIswajit_Das
    Impactful Individual

    Found a solution :-

    Z_TABLE =
    VAR _old =
    FILTER (
    'table1',
    'table1'[AC_NO - Copy]
    <>CALCULATE (
    SELECTEDVALUE('table2'[AC_NO - Copy]),
    ALLEXCEPT (
    'table1','table1'[AC_NO - Copy]
    )
    )
    )
    VAR _new = 'table2'
    RETURN
    UNION(_old,_new)