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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Grouping columns with conditional agregated function

Hi, I have this kind of data and I want to create a grouped table by G1,G2,G3 counting the rows of C column that are distinct from null with power query

 

G1G2G3KC
1111null
11121
2223null
22241
22251
3316null
33271
33381
3349null

 

So the result I want to achieve is 

 

G1G2G3Count
1111
2222
3310
3321
3331
3340

 

Any help would be appreciated. I was trying to create a function but I can´t figure how to pass the G1, G2, G3 as parameter. Perhaps I need another approach

 

Thanks,

 

Julio

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

You can directly groupby

Vera_33_0-1625622782246.png

Table.Group(yourPreviousStep, {"G1", "G2", "G3"}, {{"Count", each List.NonNullCount(_[C]), Int64.Type}})

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you @Anonymous 

Anonymous
Not applicable

Hi @Anonymous 

 

You can directly groupby

Vera_33_0-1625622782246.png

Table.Group(yourPreviousStep, {"G1", "G2", "G3"}, {{"Count", each List.NonNullCount(_[C]), Int64.Type}})

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.

Top Solution Authors