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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.