Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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 | Failed Audit |
| 8291 | Passed Audit |
| 8291 | Passed Audit |
| 8281 | Passed Audit |
| 8267 | Failed Audit |
| 8267 | Passed Audit |
I need to basically get a count of each unqieu value and put them into two separate columns like below. How can I do this in Power Query Editor?
| Store Number | Count Failed Audits | Count Passed Audits |
| 8297 | 2 | 3 |
| 8291 | 1 | 2 |
| 8281 | 0 | 1 |
| 8267 | 1 | 1 |
Solved! Go to Solution.
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}})
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}})
@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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 58 | |
| 52 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 111 | |
| 109 | |
| 40 | |
| 33 | |
| 26 |