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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RAW_PhD
Regular Visitor

Help with Identifying Correct Function to Use

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!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RAW_PhD ,

Consider grouping by [Test ID #] and [Person Name] and counting the number of fails:

vcgaomsft_0-1716514448981.png

 

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





View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @RAW_PhD ,

Consider grouping by [Test ID #] and [Person Name] and counting the number of fails:

vcgaomsft_0-1716514448981.png

 

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





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors