Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
* EDIT: apparently PowerQuery got scared when I posted this message - the new custom column "= Table.AddColumn(#"Merged with Total based on CN ID", "RowCount", each Table.RowCount([Total.Table]))" now does work quite well. Not sure what I did differently, but there you go. Case closed, I'd say."
Dear all,
This is my first time posting, so apologies if I missed a forum best-practice.
This is to kindly ask for views on / help on a seemingly simple issue I cannot get my head around despite browsing forums for the past 2-3 hours.
Essentially, I'm trying to do a Table.RowCount or List.Count on nested tables inside a column after NestedJoin (see screenshot).
The screenshot shows column "Total.Table" containing nested tables after performing a Merge Query operation based on a common key column between two tables. Now, I'd like PQ to only count / return the number of non-empty rows per nested table.
I've tried doing this by
Finally, I've tried buffing the CN RP 2 table and the nested tables in its column Total.Table - but buffering is a rabbit hole on its own, and I've not managed.
Like I said, I've read a lot of forum posts, and have done this operation for smaller files (although the current file is only 4.8 MB in Excel) without any issues. Would welcome any thoughts on errors and omissions on my end.
Many thanks, wishing you all a good day and an icecream for those suffering the heat.
Paul
Hi @PaulBoot ,
Here’s a way I’ve found works well and keeps things running smoothly, even on bigger files:
let
BufferedTable = Table.Buffer(#"PreviousStep"),
RowCountColumn = Table.AddColumn(BufferedTable, "RowCount", each Table.RowCount([Total.Table]), Int64.Type)
in
RowCountColumn
A couple more tips to keep things fast,Try to remove any columns you don’t need from [Total.Table] before the merge, so you’re not carrying extra data through each nested table. If you can, aggregate or count rows at the source (in SQL, a dataflow, etc.) and merge those results in, instead of doing the counting in Power Query, this is often much faster on big datasets. Make sure you turn off background data previews in Power Query while editing, so it’s not constantly re-evaluating the steps.
If you ever need to count only certain rows in the nested table (for example, only non-blanks), you can do something like: Table.AddColumn(BufferedTable, "NonBlankCount", each List.Count(List.Select([Total.Table][YourColumn], each _ <> null)))
Thanks Rohit! That model was a long time ago - don't have it anymore, but thanks for thinking along. i can't say whether or not your proposal would have solved it, but apprecaite the effort!
I have the same problem. the "Differences" Column is loading in powerQuery, but not in PowerBI.
Did you find a solution?
Lol
--Nate