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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

GROUP BY category with not null counts

 I have a table with three columns(Team name, created date, and completed date)

 

teamcreatedcompleted
A1/1/2022   1/1/2022
A1/3/2022   null
A1/3/2022   1/3/2022
A1/3/2022    null
A1/5/2022   1/5/2022
R1/1/2022  1/1/2022
R1/3/2022  1/3/2022
R1/3/2022  null
R1/3/2022  1/3/2022
T1/5/2022  1/5/2022
T1/1/2022  null
T1/3/2022  1/3/2022

 

 

what i want to do is group by team  and get the created and complted tickets counts. Like below result i only need to get the count for dates not null values,

 

ex: team A created 5 tickets but complted only 3 because of two null values.

 

Expected output:

 

teamcreatedcompleted
A53
R43
T32

 

Tried to get this usging power query group by but didnt get the expected output.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

pls try this

 

= Table.Group(#"Changed Type", {"team"}, {{"Count", each List.NonNullCount([created]), Int64.Type}, {"Count2", each List.NonNullCount([completed]), Int64.Type}})

 

1.PNG

pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

Created = countrows(Data)

Completed count = calculate([Created],Data[completed]<>blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks. but how do i group by teams?

ryan_mayu
Super User
Super User

@Anonymous 

pls try this

 

= Table.Group(#"Changed Type", {"team"}, {{"Count", each List.NonNullCount([created]), Int64.Type}, {"Count2", each List.NonNullCount([completed]), Int64.Type}})

 

1.PNG

pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks. Did u do the above code by clicking "Group By" button or just using the code?

you can click group by and select count first, then update the formula.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.