March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there!
I have 1st table here with some incorrect data and would like to replace it based on the 2nd table.
The value in red font is wrong, the correct data is in 2nd table.
I would like to change the waterusage.value for ID 21345 at year 2021 to 50, instead of 12000 in table 1. Similar to waterusage.value of ID 9281 at year 2021, change to 300 instead of 40000.
I tried to use table.replacevalue(#"Added Custom", each [waterusage.value], each if Table2{[waterusage.value] = value then Table2[waterusage.value], Replacer.ReplaceText,{"waterusage.value"})
But I notice it is not feasible because there might be addtional columns in table 2, such as if we found more incorrect data in table 1, we will need to add new column in table 2 like energyusage.value, wastedisposal.value. Is there any way if we not hard code the column name and the code will directly take table 2 value if it found the column there?
Thank you
Solved! Go to Solution.
suppose the bound value of year and ID in table 2 is unique, you can try this code.
NewStep in Table1=Table.FromRecords(Table.TransformRows(Table1,each _&(Table2{[Year=[Year],ID=[ID]]}? ??[])))
yes, they are unique. and the code works well! thank you!
suppose the bound value of year and ID in table 2 is unique, you can try this code.
NewStep in Table1=Table.FromRecords(Table.TransformRows(Table1,each _&(Table2{[Year=[Year],ID=[ID]]}? ??[])))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |