Kommentare zu: Spaltensummen bei flexibler Tabellenstruktur https://ssbi-blog.de/blog/business-topics/spaltensummen-bei-flexibler-tabellenstruktur/ Wir lieben Microsoft Power BI Thu, 17 Jul 2025 12:25:42 +0000 hourly 1 https://wordpress.org/?v=6.8.3 Von: Danny https://ssbi-blog.de/blog/business-topics/spaltensummen-bei-flexibler-tabellenstruktur/#comment-5466 Sat, 20 Jan 2024 15:15:05 +0000 https://ssbi-blog.de/?p=7826#comment-5466 Hallo Lars,
zuerst einmal, ich bin großer Fan von deinem Blog und deinen YouToube Videos!
Heute bin ich auf das Problem der „Gruppierungsfunktion dynamisieren“ gestoßen, am Anfang deines Artikels machst du die Bemerkung, dass du darauf in „Anmerkungen“ eingehst….dort verweist du leider auf eine „…Andere Geschichte .. “ . Leider konnte ich in deinem Blog nichts zum Thema “ Gruppierungsfunktion dynamisieren“ finden.
Kannst du mir bitte auf die Sprünge helfen?

Mein Problem:
Meine Tabelle = Quelle
Gruppieren von Spalte1[TAG]
Summenbildung aller restlichen Spalten aus Liste (ListeAndereSpalten)

Gruppierung = Table.Group(Quelle, {„TAG“},
List.Transform(ListeAndereSpalten, each {_, each List.Sum([_]), type number}))
Leider bekomme ich immer den Fehler:
„Expression.Error: Die Spalte „_“ der Tabelle wurde nicht gefunden.
Details:
_ “

Kannst du mir hier weiter helfen?
Gruß
Danny

]]>
Von: Lars Schreiber https://ssbi-blog.de/blog/business-topics/spaltensummen-bei-flexibler-tabellenstruktur/#comment-1026 Wed, 27 May 2020 20:11:12 +0000 https://ssbi-blog.de/?p=7826#comment-1026 Als Antwort auf Bill Szysz.

Hi Bill 🙂

thanks for that great comment … Two aspects of your solution I find really ingenious: 1) how you generate the MonthList is really elegant and 2) how you use List.Accumulate to add the appropriate columns to the table. Hats off. But yes, you’re right: My solution should not contain any advanced M-codes, but should work mainly via the UI. Thanks again for your input 🙂

Lars

]]>
Von: Bill Szysz https://ssbi-blog.de/blog/business-topics/spaltensummen-bei-flexibler-tabellenstruktur/#comment-1025 Wed, 27 May 2020 11:35:33 +0000 https://ssbi-blog.de/?p=7826#comment-1025 Hi Lars 🙂
Interesting issue. I know you wanted to do this mainly through the UI, so my proposal concerns a little more advanced use of the M code.
let
MonthsList = List.Transform(
{0..11},
each Date.ToText(#date(1900, 1, 1) + Duration.From(_ * 31), „MMM“, „en-GB“)
),
Source = Excel.CurrentWorkbook(){[Name = „Table1“]}[Content],
ColNames = List.Buffer(Table.ColumnNames(Source)),
Headers = List.Buffer(List.Intersect({ColNames, MonthsList})),
FirstCol = Table.FromColumns({{„Total“}}, {ColNames{0}}),
AccTbl = List.Accumulate(
Headers,
FirstCol,
(st, cur) => Table.AddColumn(st, cur, each List.Sum(Table.Column(Source, cur)), type number)
),
CombineTbls = Table.Combine({Source, AccTbl}),
#“Added Custom“ = Table.AddColumn(
CombineTbls,
„Total“,
each List.Sum(Record.ToList(Record.SelectFields(_, Headers)))
)
in
#“Added Custom“

As you can see in this case we don’t need to use Table.Transpose. Additionally we can easy change the language of months name and choose long or short form for them. Code should be fast ( i think)
Thanks for the interesting post.

]]>