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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to count the number of rows with multiple OR conditions in power query editor

Hi,

 

I want to count the number of rows with multiple OR conditions in power query editor.

for example I want to count rows based on the below conditions

11: On Time
30: Impact
30: Expedite
60: Item

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

You can do the following in PBI:

Use this option to filter this column.

Vlianlmsft_0-1635225797506.png

Group count of filtered columns

Vlianlmsft_1-1635225888500.png

 

Vlianlmsft_2-1635225899019.pngVlianlmsft_3-1635225906918.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLPUwjJzE1VitWJVjIC8j1zCxKTS8BcYyDXtaIgNSWzBCJvApIvSc0Fc0yBnNK87Lz88jww3wxVszm6Zgs0yyxR1RsaoJlnaIimwAjdRENjNCMNTTCUmKIrMUMXMEezxgLDDEv0YDJAV2JkiOZ4IyNkgVgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Status = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Status", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Status] <> "unknown")),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Status"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
    #"Grouped Rows"

 

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
Community Support

You can do the following in PBI:

Use this option to filter this column.

Vlianlmsft_0-1635225797506.png

Group count of filtered columns

Vlianlmsft_1-1635225888500.png

 

Vlianlmsft_2-1635225899019.pngVlianlmsft_3-1635225906918.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLPUwjJzE1VitWJVjIC8j1zCxKTS8BcYyDXtaIgNSWzBCJvApIvSc0Fc0yBnNK87Lz88jww3wxVszm6Zgs0yyxR1RsaoJlnaIimwAjdRENjNCMNTTCUmKIrMUMXMEezxgLDDEv0YDJAV2JkiOZ4IyNkgVgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Status = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Status", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Status] <> "unknown")),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Status"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
    #"Grouped Rows"

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.