PQ: Text.Combine + Sum of Values with Dates

Pulsar3000

New Member
Joined
Apr 19, 2021
Messages
46
Office Version
  1. 365
Platform
  1. Windows
Hi All:

I have a group of rows whose text in the Description column is being combined based on each unique value of the Index column.
However, I also have a Date column. Each unique value in the Index Column has one date only that I want reflected in the output.
Additionally, three other columns (Credit, Debit, and Balance) should be totaled based on each unique value of the index column.

Right now I have the below code but get the error "We cannot convert a value of Type List to Type Text."

Table.Group(#"Changed Typed", {"Index"}, {{"Description", each Text.Combine([Description], " | "),type text}, {{Date}, {{"Credit", each List.Sum([Credit]), type nullable number}, {"Debit", each List.Sum([Debit]), type nullable number}, {"Balance", each List.Sum([Balance]), type nullable number}}}})
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi All:

I have a group of rows whose text in the Description column is being combined based on each unique value of the Index column.
However, I also have a Date column. Each unique value in the Index Column has one date only that I want reflected in the output.
Additionally, three other columns (Credit, Debit, and Balance) should be totaled based on each unique value of the index column.

Right now I have the below code but get the error "We cannot convert a value of Type List to Type Text."

Table.Group(#"Changed Typed", {"Index"}, {{"Description", each Text.Combine([Description], " | "),type text}, {{Date}, {{"Credit", each List.Sum([Credit]), type nullable number}, {"Debit", each List.Sum([Debit]), type nullable number}, {"Balance", each List.Sum([Balance]), type nullable number}}}})

I figured it out. Basically just tweaked the Date item.


Table.Group(#"Changed Typed", {"Index"}, {{"Description", each Text.Combine([Description], " | "),type text}, {"Date", each List.Max([Date]), type date}, {"Credit", each List.Sum([Credit]), type nullable number}, {"Debit", each List.Sum([Debit]), type nullable number}, {"Balance", each List.Sum([Balance]), type nullable number}})
 
Upvote 0

Forum statistics

Threads
1,225,601
Messages
6,185,924
Members
453,333
Latest member
BioCoder84

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