The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have 2 tables as follows :
tracking
-------------
Agency | Estimate | Media | Remarks | Cost | Invoice | Invoice Date | Billable AR | Billable AP |
ABC | P.123456 | R123 | R_12_A | 0 | 0 | 0 | ||
ABC | P.123456 | R124 | R_12_B | 120 | 0 | 0 | ||
BCD | P.123457 | R125 | R_13_A | 0 | 0 | 0 |
outstanding
-------------
Agency | Estimate | Media | Remarks | Cost | Invoice | Invoice Date | Billable AR | Billable AP |
ABC | P.123456 | R124 | R_12_B | 120 | 1234567890 | 2024-01-01 | 120 | 0 |
If outstanding table contains data with same column values for "agency", "estimate", "media", "remarks" and "costs" compare it with tracking table with same columns, then data in tracking table will be updated based on latest data from outstanding table, only values in "invoice", "invoice date", "billable AR" and "billable AP" columns will be updated.
expected results :
tracking
-------------
Agency | Estimate | Media | Remarks | Cost | Invoice | Invoice Date | Billable AR | Billable AP |
ABC | P.123456 | R123 | R_12_A | 0 | 0 | 0 | ||
ABC | P.123456 | R124 | R_12_B | 120 | 1234567890 | 2024-01-01 | 120 | 0 |
BCD | P.123457 | R125 | R_13_A | 0 | 0 | 0 |
Any help would be appreciated.
Thanks in advance !
Solved! Go to Solution.
I've found the answer,
1. using merger queries LeftOuter ( tracking table as first table, and outstanding as second table )
2. expand desired columns from outstanding table in tracking table
3. using replace value on desired column if from column expansion has a value
I don't know if there is another quick way, but this is the only way I found.
Hi @gzai ,
There is another way to accomplish this:
1.Click append queries,
2.Remove duplicate rows
3.Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
I've found the answer,
1. using merger queries LeftOuter ( tracking table as first table, and outstanding as second table )
2. expand desired columns from outstanding table in tracking table
3. using replace value on desired column if from column expansion has a value
I don't know if there is another quick way, but this is the only way I found.
Hi @gzai ,
There is another way to accomplish this:
1.Click append queries,
2.Remove duplicate rows
3.Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
User | Count |
---|---|
86 | |
85 | |
35 | |
35 | |
35 |
User | Count |
---|---|
94 | |
79 | |
63 | |
55 | |
52 |