Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a table with 3 columns:
Person Name, Test ID #, and Pass/Fail
I need to identify which row has a person who has failed a specific Test ID# total of 3 times.
I've tried sorting on the Test ID#, and counting the people column, but that doesn't tell me if they passed/failed.
I can't seem to come up with the logical expression to identify who failed which test 3 times.
Any help would be greatly appreciated!
Solved! Go to Solution.
Hi @RAW_PhD ,
Consider grouping by [Test ID #] and [Person Name] and counting the number of fails:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRU0lEyNDAwBFJuiZk5SrE60UpOTlgEnZ0RggGJxcVgQRcXLIKurlgECVoEVwmzyAibRUbI2mEWGRFtkRE2i4yJtsgYLhgLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Person Name" = _t, #"Test ID #" = _t, #"Pass/Fail" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Person Name", type text}, {"Test ID #", Int64.Type}, {"Pass/Fail", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type",{"Person Name", "Test ID #"},{{"Data", each _}, {"Number of fails", each Table.RowCount(Table.SelectRows(_,(x)=> x[#"Pass/Fail"]="Fail"))}}),
#"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Pass/Fail"}, {"Pass/Fail"})
in
#"Expanded Data"
For specific ids, next you can filter further.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi @RAW_PhD ,
Consider grouping by [Test ID #] and [Person Name] and counting the number of fails:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRU0lEyNDAwBFJuiZk5SrE60UpOTlgEnZ0RggGJxcVgQRcXLIKurlgECVoEVwmzyAibRUbI2mEWGRFtkRE2i4yJtsgYLhgLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Person Name" = _t, #"Test ID #" = _t, #"Pass/Fail" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Person Name", type text}, {"Test ID #", Int64.Type}, {"Pass/Fail", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type",{"Person Name", "Test ID #"},{{"Data", each _}, {"Number of fails", each Table.RowCount(Table.SelectRows(_,(x)=> x[#"Pass/Fail"]="Fail"))}}),
#"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Pass/Fail"}, {"Pass/Fail"})
in
#"Expanded Data"
For specific ids, next you can filter further.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
11 | |
7 | |
6 | |
6 |