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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
erg24
Regular Visitor

% from two columns of pass/fail SLA rate

Hi,

 

I am struggling with being able to add a % for PASS and % for FAIL

 

I need to use the pass/fail and the count of ticket number to do this, I've tried various different ways however can't seem to get this right.

 

Screenshot 2022-02-15 at 18.15.34.png

 

Thanks

Liz

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @erg24 ,

 

Please try:

Measure = 
var _count=COUNTROWS('Table')
var _fail=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Fail"))
var _pass=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Pass"))
return IF(ISINSCOPE('Table'[Pass/Fail]),_count, DIVIDE(_fail,_pass))

Eyelyn9_0-1645167168327.png

 

If you want to set different format, please try:

format = 
var _count=COUNTROWS('Table')
var _fail=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Fail"))
var _pass=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Pass"))
return IF(ISINSCOPE('Table'[Pass/Fail]), FORMAT(_count,"##"), FORMAT(DIVIDE(_fail,_pass) ,"#.0%"))

But it returns Text type not Number type:

Eyelyn9_1-1645167294676.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @erg24 ,

 

Please try:

Measure = 
var _count=COUNTROWS('Table')
var _fail=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Fail"))
var _pass=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Pass"))
return IF(ISINSCOPE('Table'[Pass/Fail]),_count, DIVIDE(_fail,_pass))

Eyelyn9_0-1645167168327.png

 

If you want to set different format, please try:

format = 
var _count=COUNTROWS('Table')
var _fail=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Fail"))
var _pass=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Pass/Fail]="Pass"))
return IF(ISINSCOPE('Table'[Pass/Fail]), FORMAT(_count,"##"), FORMAT(DIVIDE(_fail,_pass) ,"#.0%"))

But it returns Text type not Number type:

Eyelyn9_1-1645167294676.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

jennratten
Super User
Super User

Here is a post that will likely help you.  If it does not, please provide more details showing the structure of your dataset, measures and provide an example.

 

https://community.powerbi.com/t5/Desktop/Percent-of-Total-Within-Hierarchy-Drilldown/m-p/777948 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.