How to merge rows (Date format) with power query

Sian1

Board Regular
Joined
Nov 9, 2009
Messages
90
Hi how can i merge rows and columns from
IDPending DateReasonComments
R-001A1WO
1/27/2022​
Policy Document ReviewDraft sent to local contact for review and signature
R-001A1WO
1/21/2022​
Policy Document Reviewpolicy draft sent to local client for review and acceptance
R-001A1WO
1/18/2022​
Policy Document Reviewdraft sent, waiting for approval
R-001A1YO
9/2/2021​
Policy Document Reviewquestions to PO sent via mail
R-001A1YO
2/18/2022​
Policy Document Reviewquestions to PO send via mail
R-001A1YO
2/23/2022​
Terms & Conditions ReviewPending issuance order form local broker
R-001A1ZS
2/23/2022​
Policy Document ReviewDraft sent to the local broker for approval
R-001A203
1/31/2022​
Policy Document Reviewpolicy draft sent to local broker for review and acceptance
R-001A206
1/11/2022​
Terms & Conditions ReviewPending issuance order from local broker
R-001A206
1/11/2022​
Terms & Conditions ReviewPending issuance order from local broker
R-001A20C
1/16/2022​
KYC / AML FormsAn email sent to the broker that we need to open a new account code in our systems, so please provide the KYC and others under the same list/ requirements, in addition to payment request (proforma invoice) due to back dated policy.
R-001A21Q
1/25/2022​
Otherpremium outstanding. •BNCOO210000000001037 - 988.121 •BNCOO210000000002432 - 6 686.801 •BNCOO210000000002437 - 1 055.439
R-001A21Q
2/10/2022​
KYC / AML FormsStill waiting for the contact number
R-001A21W
12/1/2021​
OtherWaiting for issuance order.
R-001A21X
2/7/2022​
OtherPolicy cannot be issued until previous premium is payed.
R-001A229
2/14/2022​
OtherUpfront premium requested from local AON broker because inception is older than 5 months - also missing the client bank details letter as it was not provided along with the ID of authorized signatory
R-001A22D
11/8/2021​
Policy Document Reviewpolicy draft sent to PO for confrimation, questions to PO are in the draft
R-001A22K
9/2/2021​
Policy Document Review
R-001A22K
2/7/2022​
Policy Document Review

to this;
IDPending DateReason; Comments
R-001A1WO1/27/2022;
1/21/2022;
1/18/2022;
Policy Document Review; Draft sent to local contact for review and signature
Policy Document Review; policy draft sent to local client for review and acceptance
Policy Document Review; draft sent, waiting for approval

appreciate any helps
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Give these steps a try.

First merges the Reason and Comments together in one column, delimiting it by a semi colon.
Then a Group By, but instead of a List.Sum, you are doing a Text.Combine, which isn't available in the walk through window when you click the Group By button.

#"Merged Columns" = Table.CombineColumns(PREVIOUS STEP,{"Reason", "Comments"},Combiner.CombineTextByDelimiter("; ", QuoteStyle.None),"Reason; Comments"),
#"Grouped Rows" = Table.Group(#"Merged Columns", {"ID"}, {{"Pending Date", each Text.Combine([Pending Date],"; ")},{"Reason; Comments", each Text.Combine([Reason; Comments]," ")}}
 
Upvote 0
thanks, however i got this error message
1645826679424.png

Give these steps a try.

First merges the Reason and Comments together in one column, delimiting it by a semi colon.
Then a Group By, but instead of a List.Sum, you are doing a Text.Combine, which isn't available in the walk through window when you click the Group By button.

#"Merged Columns" = Table.CombineColumns(PREVIOUS STEP,{"Reason", "Comments"},Combiner.CombineTextByDelimiter("; ", QuoteStyle.None),"Reason; Comments"),
#"Grouped Rows" = Table.Group(#"Merged Columns", {"ID"}, {{"Pending Date", each Text.Combine([Pending Date],"; ")},{"Reason; Comments", each Text.Combine([Reason; Comments]," ")}}
Hi thanks, however i still get the error message;
1645826679424.png
 
Upvote 0
Try this:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"Pending Date", type text}, {"Reason", type text}, {"Comments", type text}}),
    #"Merged Columns" = Table.CombineColumns(#"Changed Type",{"Reason", "Comments"},Combiner.CombineTextByDelimiter("; ", QuoteStyle.None),"Reason_Comments"),
    GroupedRows=Table.Group(#"Merged Columns", {"ID"}, {{"Pending Date", each Text.Combine([Pending Date], Character.FromNumber(10))},{"Reason_Comments", each Text.Combine([Reason_Comments], Character.FromNumber(10))}})
in
    GroupedRows
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top