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

Join 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.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.