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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
E_K_
Helper III
Helper III

Help with errors in Group by List.sum in power query?

I'm trying to create a group by table per date and client. All the other columns are fine other than the "On Time Packages" column 
This is for column On Time, with shows for each package a 0 if it was on time and 1 if it was late. The column is number type and there are no null values. 

I've tried numerous different things to try to get this to work: even created another column to try the same thing by creating a Y for on time and N for late and trying to count the Ys and that still doesn't work. Please help!!

Table.Group(
#"Added Custom",
{"package_date"},
{
{"Overall Delay", each List.Sum([Delay in mins]), type number},
{"Average Delay", each List.Median([Delay in mins]), type number},
{"On Time Packages", each List.Sum(List.Select([On Time ], each _ =0)), type nullable number},
{"Total Packages", each Table.RowCount(_), type number}
}
)

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @E_K_,

 

It looks like you're on the right track with your approach to grouping in Power Query. 

 

Here's a slightly revised version of your query:

Table.Group(
    #"Added Custom",
    {"package_date"},
    {
        {"Overall Delay", each List.Sum([Delay in mins]), type number},
        {"Average Delay", each List.Average([Delay in mins]), type number},
        {"On Time Packages", each List.Count(List.Select([On Time], each _ = 0)), type number},
        {"Total Packages", each Table.RowCount(_), type number}
    }
)

 


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

1 REPLY 1
Sahir_Maharaj
Super User
Super User

Hello @E_K_,

 

It looks like you're on the right track with your approach to grouping in Power Query. 

 

Here's a slightly revised version of your query:

Table.Group(
    #"Added Custom",
    {"package_date"},
    {
        {"Overall Delay", each List.Sum([Delay in mins]), type number},
        {"Average Delay", each List.Average([Delay in mins]), type number},
        {"On Time Packages", each List.Count(List.Select([On Time], each _ = 0)), type number},
        {"Total Packages", each Table.RowCount(_), type number}
    }
)

 


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors