Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Update Changes data from 2 tables

Hi Teams,

I have 2 tables and I make the comparison between them. I added one more column called "Updated Comparation". If columns in  NewData table is different from OldData table, then "Updated Comparation" will update the  NewData[Last Updated] values. 

 

 2 first rows the information is different so "Updatad Comparation" show the value. Since FirstNames are different from 2 tables, now I want to replace the FirstNames from Olddata by NewData. (ken => kenneth, bob => robert)

My code so far is bellow. How to I replace the values of FirstNames? Tks 

 

Updated Comparation = if(RELATED(NewData[CustomerId]) <> [CustomerId] || RELATED(NewData[First Name]) <> [First Name] || RELATED(NewData[Last Name])<>[Last Name] || RELATED(NewData[Customer Type]) <> [Customer Type] || RELATED(NewData[Last Updated]) <>[Last Updated], RELATED(NewData[Last Updated]))
 
 
  • HI, Anonymous 

    Do you mean that you want to update the data in the original data column?

    If so, you could not get it in power bi for now.

    You could create the new column as amitchandak said, or use the same logic to create a New table.

     

    Regards,

    Lin

2 Replies

  • Try creating columns like this and then use them in calculation

     

    Max customer = MAXX(filter(Sales,Sales[Order Id]='Item'[Max Sales order id] && Sales[item_id]='Item'[Item ID]),Sales[Customer ID])

     

    Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
    Thanks.

    My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    HI, Anonymous 

    Do you mean that you want to update the data in the original data column?

    If so, you could not get it in power bi for now.

    You could create the new column as amitchandak said, or use the same logic to create a New table.

     

    Regards,

    Lin