Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PhilippeMuniesa
Resolver I
Resolver I

Table.AggregateTableColumn with list of list and conditional function

Hello,

I have a table with several columns, I created a list of column headers. then I grouped in a DATA column the columns of the table without aggregation. I would then like to expand the tables in the DATA column using different aggregations based on the column name (element of the list of column names).

 

I tried .... ,

Aggreg2 = Table.AggregateTableColumn(
Groupe_table,
"Data",
List.Transform(My_Liste, each {if _ (Text.Contains(_,"50.002")) then List.Max else List.Sum, _, type number})
),

 

 

but obviously the syntax is wrong. Attached is a link to download the table and the request in excel. 

 

https://www.dropbox.com/t/19UlLRnUgBpQTwim

 

Thanks for any help

 

Philippe

 

 

 

 

2 ACCEPTED SOLUTIONS
ronrsnfld
Super User
Super User

I think your aggregation list is incorrect syntax.

 

Try:

 

 

List.Transform(My_Liste, each if Text.Contains(_,"50.002") then {_, List.Sum, "sum of " & _, type number} else {_, List.Max, "Max of " & _, type number})

 

View solution in original post

PhilippeMuniesa
Resolver I
Resolver I

Thank you very much,

I still have a bit of trouble with lists and list.transform

 

Philippe

View solution in original post

2 REPLIES 2
PhilippeMuniesa
Resolver I
Resolver I

Thank you very much,

I still have a bit of trouble with lists and list.transform

 

Philippe

ronrsnfld
Super User
Super User

I think your aggregation list is incorrect syntax.

 

Try:

 

 

List.Transform(My_Liste, each if Text.Contains(_,"50.002") then {_, List.Sum, "sum of " & _, type number} else {_, List.Max, "Max of " & _, type number})

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.