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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply

How do I change the M code to ensure any new columns added each month will get included? Edited

I noticed I had to manually type in the additional Approver columns after refresh from 8 to 11

Is there a way if doing that with a different code so any new approver columns will automatically be added?

 

 

let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"App Group name", type text}, {"App Group name(T)", type text}, {"User", type text}, {"Description", type text}, {"User type(T)", type text}, {"Value", Int64.Type}}),

#"Grouped Rows" = Table.Group(#"Changed Type", {"App Group name"}, {{"Approver", each Text.Combine([Description], ", ")}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Grouped Rows", "Approver", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Approver.1", "Approver.2", "Approver.3", "Approver.4", "Approver.5", "Approver.6", "Approver.7", "Approver.8",}), "Approver.9", "Approver.10", "Approver.11"
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Approver.1", type text}, {"Approver.2", type text}, {"Approver.3", type text}, {"Approver.4", type text}, {"Approver.5", type text}, {"Approver.6", type text}, {"Approver.7", type text}, {"Approver.8", type text}, {"Approver.9", type text}, {"Approver.10", type text}, {"Approver.11", type text}})
in
#"Changed Type1"

 

Thanks you in advance

5 REPLIES 5
slorin
Super User
Super User

Hi,

 

= Table.TransformColumnTypes(
#"Split Column by Delimiter",
List.Transform(
List.Select(
Table.ColumnNames(#"Split Column by Delimiter"),
each Text.StartsWith(_,"Approver")),
each {_, type text})
)

Stéphane 

thank you but where about in the advanced editor do I add that? I gave my current in my post at the top

#"Changed Type1"

 

#"Changed Type1" = Table.TransformColumnTypes(
#"Split Column by Delimiter",
List.Transform(
List.Select(
Table.ColumnNames(#"Split Column by Delimiter"),
each Text.StartsWith(_,"Approver")),
each {_, type text})
)

 Stéphane

I am expecting more approvers to be added after the 11th. 

PijushRoy
Super User
Super User

@michellerob2000 
Is it limited to Approver 11 or you want more column




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.