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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Vera_33
Resident Rockstar
Resident Rockstar

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 @Vera_33 

Vera_33
Resident Rockstar
Resident Rockstar

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors