Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm trying to add a custom column using the sum of a large (undefined) number of previous columns.
Based on a similar use-case I've read about I was trying the following code:
The idea is to list all the columns beginning with "Id_" and using this list to add in the "add" statement.
Using this code I'm generating the list:
The following Error occurse :
But also adapting to code to:
SumRows = Table.AddColumn(#"Pivoted Column", "Addition", each (ColumnsToSum))
or SumRows = Table.AddColumn(#"Pivoted Column", "Addition", each ({ColumnsToSum}) is not successful
Any ideas if this could work and if I have a mistake in my code or does this "using a list to add a large number of columns" not work at all.
appreciate some feedback 🙂
Solved! Go to Solution.
Hi @fishboneox,
Add an [Index] first.
Add a custom column like this:
= Table.AddColumn(#"Added Index", "Total", each List.Sum(List.Select(Record.FieldValues(#"Promoted Headers"{[Index]}),each _ is number)))
Best regards,
Yuliana Gu
Hi @fishboneox,
Add an [Index] first.
Add a custom column like this:
= Table.AddColumn(#"Added Index", "Total", each List.Sum(List.Select(Record.FieldValues(#"Promoted Headers"{[Index]}),each _ is number)))
Best regards,
Yuliana Gu
Thanks for your support. This works perfectly 😉
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
88 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |