Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PaulBoot
New Member

CountRows in nested table performance issues

* 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).

PaulBoot_0-1692776252513.png

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

 

  1. adding a new custom column with the formula "Table.RowCount([Total.Table])" > this keeps on loading one of the source files, but it takes 30+ minutes if it loads at all.
  2. Using the "aggregate" function on the Total.Table column with a #Count of ID (ID being one of the columns in the nested table) > same result
  3. Creating a new blank query with formula "= let RowCount = List.Count(#"CN RP 2"[Total.Table]) in RowCount" > this gets me the total number of rows not in the nested table but in the main table - I was trying to creat a function but don't quite know how to do this.
  4. Creating another blank query with formula "= let TableRowCount = Table.RowCount(#"CN RP 2") in TableRowCount > idem

 

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

 

 

1 REPLY 1
watkinnc
Super User
Super User

Lol

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors