Reply
wereleopard
Regular Visitor

Multiple columns containing PASS / FAIL how to show a list of highest to lowest

Hello

I have multiple questions on a sharepoint list that can be a PASS or FAIL and need to show which of these questions has the highest number of 'FAIL's 

E.G

Source data:

Week Question 1Question 2Question 3Question 4
1PASSPASSPASSPASS
1FAILPASSPASSPASS
1PASSPASS

FAIL

PASS
1PASSPASSFAILPASS
1PASSPASSFAILPASS
1PASSPASSPASSPASS
1PASSPASSPASSPASS
1PASSPASSPASSPASS
1PASSPASSPASSFAIL
1PASSPASSPASSFAIL
1PASSPASSPASSPASS

 

The ideal report visual would be:

QuestionFail Count
Question 33
Question 42
Question 11
Question 20

 

Can anybody help as to how I can build this table?

Thanks

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

In Power Query select the week column and then choose Unpivot Other Columns from the Transform ribbon.

You can then create a measure like

Fail Count = CALCULATE( COUNTROWS( 'Table' ), 'Table'[Value] = "FAIL" )

View solution in original post

3 REPLIES 3
Bibiano_Geraldo
Super User
Super User

HI @wereleopard ,

First lets do some transformation in power query:

Step 1: Unpivot your data

In Power Query Editor, select the week column, right-click and choose Unpivot Other Columns as shown bellow. 

Bibiano_Geraldo_0-1731366033248.png

 

Now your data should look like this:

Bibiano_Geraldo_1-1731366137097.png

 

Now your can rename this columns for what you want and close and apply.

 

Step 2: Create a measure to count FAILs by this DAX:

Fail Count = 
CALCULATE(
    COUNTROWS('YourTableName'),
    'YourTableName'[Value] = "FAIL"
)

 

Step 3: Create a table visual:

  1. Add a new table visual to your report.
  2. Drag the Attribute field (which contains the question names) to the Rows section.
  3. Drag the Fail Count measure to the Values section.

Bibiano_Geraldo_3-1731366597661.png

 

Step 4: Show items with no data:

Bibiano_Geraldo_2-1731366577806.png

 

Step 4: Click on the column header for Fail Count to sort the table by the number of FAILs in descending order.

Bibiano_Geraldo_4-1731366787136.png

 

I hope this satisfies your need, if yes, please mark it as solution and give a Kudo

 

johnt75
Super User
Super User

In Power Query select the week column and then choose Unpivot Other Columns from the Transform ribbon.

You can then create a measure like

Fail Count = CALCULATE( COUNTROWS( 'Table' ), 'Table'[Value] = "FAIL" )

Wonderful - thank you!
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)