Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
Solved! Go to Solution.
You can do the following in PBI:
Use this option to filter this column.
Group count of filtered columns
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"
You can do the following in PBI:
Use this option to filter this column.
Group count of filtered columns
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"
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
10 | |
6 | |
3 | |
2 | |
2 |