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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
egghead
New Member

How to Transform Pass/Fail Question Data

I am new to Power BI and I am looking for some help on how to transform Pass/Fail Question data so I can display the responses in a Power BI bar chart. I have an excel file with six columns Site Name, Date, Assessor, Question 1, Question 2 and Question 3. 

 

Transform Pass Fail Power BI Data.JPG

 

My objective is to Transform the data by adding the pass/fail values for each of the Question columns and displaying a bar chart with each of the totals broken down by site name. Ideally, the bar chart would include a Site Name on the X axis and either a stacked bar (Pass and Fail) or two bar values (Pass and Fail) for each of the Sites on the Y Axis.   

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@egghead 

select the first three columns and unpivot other columns. then it will be easier for you to do the calculation

11.png12.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

rajendraongole1
Super User
Super User

Hi @egghead - In Power Query editor, transform tab--> Unpivot the Question Columns

To reshape your data, you will need to unpivot the Question columns:

  1. In the Power Query Editor, select the Site Name, Date, and Assessor columns.
  2. Right-click on the selected columns and choose Unpivot Other column transformationrajendraongole1_0-1717465364172.png

     

close and apply the changes in power query editor, 

Using dax, create an measure for pass as below:

Total Pass = CALCULATE(COUNT('Table'[Result]), 'Table'[Result] = "Pass")

another measure for fail:

Total Fail = CALCULATE(COUNT('Table'[Result]), 'Table'[Result] = "Fail")

 

Now you can choose bar chart to display the pass/fail count for each site.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
egghead
New Member

Thank you @rajendraongole1 so much for your assistance!!! With your assistance I was able to create the desired report:Pass Fail Report Solution.JPG

rajendraongole1
Super User
Super User

Hi @egghead - In Power Query editor, transform tab--> Unpivot the Question Columns

To reshape your data, you will need to unpivot the Question columns:

  1. In the Power Query Editor, select the Site Name, Date, and Assessor columns.
  2. Right-click on the selected columns and choose Unpivot Other column transformationrajendraongole1_0-1717465364172.png

     

close and apply the changes in power query editor, 

Using dax, create an measure for pass as below:

Total Pass = CALCULATE(COUNT('Table'[Result]), 'Table'[Result] = "Pass")

another measure for fail:

Total Fail = CALCULATE(COUNT('Table'[Result]), 'Table'[Result] = "Fail")

 

Now you can choose bar chart to display the pass/fail count for each site.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





ryan_mayu
Super User
Super User

@egghead 

select the first three columns and unpivot other columns. then it will be easier for you to do the calculation

11.png12.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.