Power Query Excel Dynamic Column Expanding With And Without Conditions M Code

This video will show you how to create a dynamic flow of column expanding in Power Query by M code.

Topic:
0:00 - Intro
0:36 - Merge
1:35 - Table.ColumnNames()
2:02 - List.Transform()
2:28 - List.Select()
3:15 - Wrap up

Workbook:
docs.google.com/spreadsheets/d/1l3ytwh3ghEC1PArFhTGBUd9gmT3yi_H7/edit?usp=sharing&ouid=113026615372791522331&rtpof=true&sd=true

Formula:
1. Get column header and apply filter:
List.Select(Table.ColumnNames(City_List), each not Text.Contains(_,"Suburb"))

2. Get column header, apply and concatenate: List.Transform(List.Select(Table.ColumnNames(City_List), each not Text.Contains(_,"Suburb")), each "City_List."&_)

  • Power Query (Excel) | Dynamic column expanding with and without conditions | M Code ( Download)
  • Dynamically expanding specific columns & Optimizing code with nested let - #SaturdayWithPowerQuery ( Download)
  • Power Query - Dynamic Merge (Part 1) ( Download)
  • Filter Nested Tables before Expanding in Power Query ( Download)
  • Power Query (Excel) + M Code | Filter Column Headers Conditionally & Dynamically + Unpivot ( Download)
  • Expand columns with values and nested tables in Power Query ( Download)
  • Power Query (Excel) + M Code | Add Custom Columns (multi) with List. Accumulate and nested M code ( Download)
  • Dynamic Column Names in Power Query ( Download)
  • Dynamic Column Calculations in Power Query | 4 Crazy Solutions ( Download)
  • Power Query Trick ✅ Add Multiple Columns in 1 Go! ( Download)
  • Power Query (Excel) | Dynamic Filtering & Parameter ( Download)
  • Power Query Solution: Dynamic Column for Lowest Price - Record’s Functions & User Interface (PQC06) ( Download)
  • Power Query (Excel) | Multi Headers + Dynamic Rename (Dynamic Version). M code ( Download)
  • Filtering a Table to a Dynamic List of Values using Power Query and Power BI ( Download)
  • Power Query: How to collapse Multiple Rows to a Single Row ( Download)