I have an address list in this format:
|ID|AddrType|Company|FName |LName |Address
| 1|Visiting|ACME |Willie|Coyote|Sand Rd 10
| 1|Delivery|ACME |Road |Runner|Sand Rd 20
| 2|Visiting|Go Nuts|Chip |Munk |Tree Rd 3
| 3|Visiting|In Sane|Dale |Munk |Tree Rd 5
The Delivery type address row is only present if the delivery address differs from the visiting address. So the number of addresses can differ for each company ID
I want to get a result like this:
|ID|V_Company|V_FName|V_LName|V_Address |D_Company|D_FName|D_LName|D_Address
| 1|ACME |Willie |Coyote |Sand Rd 10|ACME |Road |Runner |Sand Rd 20
| 2|Go Nuts |Chip |Munk |Tree Rd 3 |Go Nuts |Chip |Munk |Tree Rd 3
| 3|In Sane |Dale |Munk |Tree Rd 5 |In Sane |Dale |Munk |Tree Rd 5
I have tried and failed using transpose like described in this link: https://community.powerbi.com/t5/Desktop/Merge-2-rows-in-one-row/m-p/46361#M18144
I have also tried and failed to create custom columns where I get values from the row below if the AddrType value on the row below is Delivery.
= Table.AddColumn(#"Sorted columns", "D_FName", each if [AddrTyp]="Delivery" then [FName]{[Index]+1} else FName)
I used this link as a source of visdom bu with limited success: http://excel-inside.pro/blog/2015/11/05/absolute-and-relative-references-in-power-query/
I am sure there is an easy way to get what I want. I now rely on your experience and knowledge to be able to solve it.
Please help me!