Forum Discussion

navafolk's avatar
navafolk
Helper IV
5 years ago
Solved

Merging column to current table column (without adding new column)

Hi pros, I have 2 tables like - 'Current' table: NAME CUR TYPE a usd on b eur off c jap on   - 'New' table: NAME a d e   How could I merge data from 'New...
  • v-kelly-msft's avatar
    v-kelly-msft
    5 years ago

    Hi  navafolk ,

     

    Create a calculated table using below expression:

    Table = 
    var _tab=CALCULATETABLE(VALUES('Current'[NAME]),FILTER('Current','Current'[NAME]<>BLANK()))
    Return
     ADDCOLUMNS(UNION(_tab,EXCEPT(VALUES('New'[NAME]),VALUES('Current'[NAME]))),"CUR",CALCULATE(MAX('Current'[CUR]),FILTER('Current','Current'[NAME]=EARLIER('Current'[NAME]))),"TYPE",CALCULATE(MAX('Current'[TYPE]),FILTER('Current','Current'[NAME]=EARLIER('Current'[NAME]))))

    And you will see:

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!