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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JVos
Helper IV
Helper IV

AggregateTableColumn with List.Count returns 1 instead of 0

With an aggregation I get an unexpected result. The 'parent' table is as follows:

ROUTING_ID
1
2
3

 

The 'child' table is as follows:

ROUTING_ID_FromROUTING_ID_To
123
124
125
223
224

 

Now I do a AggregateTableColumn with a List.Count, and I get as result:

ROUTING_IDNrOf_ROUTING_ID_To
13
22
31

 

Why has the last row (ROUTING_ID = 3) as number of Routings-To 1 instead of 0?

 

This is the line of code:

#"Aggregated qryRoutingTransitions_Direct2" = Table.AggregateTableColumn(#"Merged Queries3", "qryRoutingTransitions_Direct2", {{"ROUTING_ID_To", List.Count, "NrOfNextRoutings"}}),

Should I include that ROUTING_ID_To must not be null in order to not get counted as 1? Would be strange... If so: how to do that?

1 ACCEPTED SOLUTION
JVos
Helper IV
Helper IV

I've found the solution: instead of List.Count must be used List.NonNullCount.

View solution in original post

3 REPLIES 3
Chris12
Advocate I
Advocate I

I can confirm that the solution works, but could anybody explain why?!  AggregateTableColumn returns empty tables which return empty lists for columns and List.Count of an empty list is 0, after all!

JVos
Helper IV
Helper IV

I've found the solution: instead of List.Count must be used List.NonNullCount.

Thanks! Big help.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.