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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Filter group of All Rows (Power Query)

After grouping and calculating all rows per group, how can you filter that column? 

I´ve seen some answers but it does not solve what I want to do. 

In the data below, I´d like to select the rows where [INFO] starts with "C". I need to do this in [AllData] (cannot filter before the group operation):

Table.pngFilterAllRows.png

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXL29wWShgZKsToQAdeIECBphBBw9vdBCBiBVPiBVBgjBDBVwM2IBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, INFO = _t, VALUE = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"INFO", type text}, {"VALUE", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"AllData", each _, type table [ID=number, INFO=text, VALUE=number]}})
in
    #"Grouped Rows"

 

 Cheers!

 

2 ACCEPTED SOLUTIONS
FrankAT
Community Champion
Community Champion

Hi @Anonymous,

see figure formular bar:

12-03-_2020_12-21-36.png

 

Regards FrankAT

View solution in original post

AnkitBI
Solution Sage
Solution Sage

Hi @Anonymous 

 

Not sure why you need after Group by however You can perform in same step as below

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXL29wWShgZKsToQAdeIECBphBBw9vdBCBiBVPiBVBgjBDBVwM2IBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, INFO = _t, VALUE = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"INFO", type text}, {"VALUE", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"AllRows", each Table.SelectRows(_,each Text.StartsWith([INFO],"C")), type table [ID=number, Info=text, Value=number]}})
in
    #"Grouped Rows"

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

View solution in original post

3 REPLIES 3
AnkitBI
Solution Sage
Solution Sage

Hi @Anonymous 

 

Not sure why you need after Group by however You can perform in same step as below

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXL29wWShgZKsToQAdeIECBphBBw9vdBCBiBVPiBVBgjBDBVwM2IBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, INFO = _t, VALUE = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"INFO", type text}, {"VALUE", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"AllRows", each Table.SelectRows(_,each Text.StartsWith([INFO],"C")), type table [ID=number, Info=text, Value=number]}})
in
    #"Grouped Rows"

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

Anonymous
Not applicable

Hi @AnkitBI 

Thanks for the answer.

Imagine I want to group by [ID] and sum all [VALUES], but also want some data of the records where [INFO] is filtered. I need to filter after the group so I can do the sum operation of all [VALUES].

FrankAT
Community Champion
Community Champion

Hi @Anonymous,

see figure formular bar:

12-03-_2020_12-21-36.png

 

Regards FrankAT

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 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.