Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
Hello,
I would like to sum mutliple columns in a table. For now, I simply did it like this:
As the amount of columns might vary from time to time, I aim to make it more flexible. In all columns that have to be summed the word "Capacity" will always appear in the first row. Is it possible to create a Column based on a formula in the Power Query Editor which automatically sums all Columns which have the word capacity in its first row?
Thank you very much for your help.
Best regards,
Jakob
Solved! Go to Solution.
Hi @Anonymous
Can you promote the first row as header or you need the column names remain as Column1, Column2...? Here is one way if you promote the first row, my previous step is Change Type, you need to modify it accordingly
Table.AddColumn(yourPreviousStep, "Custom", (x) => List.Sum(List.Transform( List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Capacity")), each Record.Field(x,_))))
Hi @Anonymous
Can you promote the first row as header or you need the column names remain as Column1, Column2...? Here is one way if you promote the first row, my previous step is Change Type, you need to modify it accordingly
Table.AddColumn(yourPreviousStep, "Custom", (x) => List.Sum(List.Transform( List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Capacity")), each Record.Field(x,_))))
It works like this, thank you very much!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 12 | |
| 10 | |
| 6 | |
| 5 |