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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
zwambold
New Member

Calculate Pass/Fail rate as a percentage by week

Hi All, 


Need help with what I believe is a relatively simple formula but I'm a bit green. 

 

Ultimately, I want to show a week over week pass rate as a percentage. Something like below: 

 

Count of Pass by SR_ID per week/Count of Overall SR_ID per week

 

zwambold_0-1655393271216.png

I want to then graph this out in a bar chart showing percentage pass by week. 

 

1 ACCEPTED SOLUTION
rohit_singh
Solution Sage
Solution Sage

Hi @zwambold ,

Create a measure like below :

 

Pass % =


var _pass =

CALCULATE(
COUNT(Results[SR_ID]),
FILTER(
ALLEXCEPT(Results, Results[Week]),
Results[Overall] = "Pass"
)
)

var _total =

CALCULATE(
COUNT(Results[SR_ID]),
ALLEXCEPT(Results, Results[Week])
)

var _res = DIVIDE(_pass,_total, 0)

return
if(isblank(_res), 0, _res)
 
Output :
rohit_singh_1-1655397488861.png


If you want to sort the week in ascending/descening order, create a year-week index column in power query and sort the week column by that.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

 

View solution in original post

1 REPLY 1
rohit_singh
Solution Sage
Solution Sage

Hi @zwambold ,

Create a measure like below :

 

Pass % =


var _pass =

CALCULATE(
COUNT(Results[SR_ID]),
FILTER(
ALLEXCEPT(Results, Results[Week]),
Results[Overall] = "Pass"
)
)

var _total =

CALCULATE(
COUNT(Results[SR_ID]),
ALLEXCEPT(Results, Results[Week])
)

var _res = DIVIDE(_pass,_total, 0)

return
if(isblank(_res), 0, _res)
 
Output :
rohit_singh_1-1655397488861.png


If you want to sort the week in ascending/descening order, create a year-week index column in power query and sort the week column by that.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

 

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.