Forum Discussion
Anonymous
5 years agoNot applicable
Power Query Editor Count of Unique Column Values Into Two Columns
I have two columns in a Table as seen below. Store Number Audit Violation 8297 Failed Audit 8297 Passed Audit 8297 Failed Audit 8297 Passed Audit 8297 Passed Audit 8291 F...
- 5 years ago
Hi Anonymous ,
In case you still want to do it in PQ Editor.
= Table.Group(#"Changed Type", {"Store Number"}, {{"Count Failed Audits", each Table.RowCount(Table.SelectRows(_, each ([Audit Violation] = "Failed Audit"))), Int64.Type}, {"Count Passed Audits", each Table.RowCount(Table.SelectRows(_, each ([Audit Violation] = "Passed Audit"))), Int64.Type}})
amitchandak
5 years agoSuper User
Anonymous , to me this seems like unpivot with count.
First, create a combined column
Audit Violation = [Audit] & " " & [Violation]
using this column unpivot and take count
https://radacad.com/pivot-and-unpivot-with-power-bi