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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kmle
New Member

Measure % of Total if Value is X or Y

Hi, 

 

I have a table of tasks that can be designated "Complete", "N/A", or "Open". I just want to measure the percentage of "Complete" or "N/A" designated tasks vs total amount of tasks. I'm currently using the formula below but I'm not sure how to factor "N/A" into this. I assume it's an OR function but not sure where to include. 

 

% Complete = DIVIDE (
CALCULATE ( COUNT ( Audit_Readiness_v5_SP[Status]), Audit_Readiness_v5_SP[Status] = "Complete" ),
CALCULATE ( COUNT ( Audit_Readiness_v5_SP[Status] ), ALLSELECTED (Audit_Readiness_v5_SP[Status] )
))
 
Help would be appreciated. 
1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @kmle ,

 

Assuming you have a table like this.

 

1.PNG

 

Create the measures

 

Total Tasks = COUNTROWS(Table1)
Completed OR N/A Task = COUNTROWS(FILTER(Table1, Table1[Status] IN {"Completed","N/A"}))
%Completion = DIVIDE([Completed OR N/A Task],[Total Tasks],0)

 

1.PNG

 

 

Regards

Harsh Nathani

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

5 REPLIES 5
harshnathani
Community Champion
Community Champion

Hi @kmle ,

 

Assuming you have a table like this.

 

1.PNG

 

Create the measures

 

Total Tasks = COUNTROWS(Table1)
Completed OR N/A Task = COUNTROWS(FILTER(Table1, Table1[Status] IN {"Completed","N/A"}))
%Completion = DIVIDE([Completed OR N/A Task],[Total Tasks],0)

 

1.PNG

 

 

Regards

Harsh Nathani

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Thank you @harshnathani! Took care of it!

lance_6
Helper II
Helper II

I think something like this should work

 

VAR _numerator = 
CALCULATE(
 COUNTROWS(Audit_Readiness_v5_SP),
 FILTER(Audit_Readiness_v5_SP[Status] = "Complete" 
        || Audit_Readiness_v5_SP[Status] = "N/A"
       )
VAR _denominator = 
COUNTROWS(Audit_Readiness_v5_SP)

RETURN
_numerator/_denominator

 

I'm returning the following error when trying to the DAX you shared:

 

The syntax for 'VAR' is incorrect. (DAX(CALCULATE( COUNTROWS(Audit_Readiness_v5_SP), FILTER(Audit_Readiness_v5_SP[Status] = "Complete" || Audit_Readiness_v5_SP[Status] = "N/A" )VAR _denominator = COUNTROWS(Audit_Readiness_v5_SP)RETURN_numerator/_denominator)).

Sorry for the late response. It looks like you got it taken care of. But I believe the is just needing to name the measure ex: 

 

 

my_measure =
VAR _numerator = 
CALCULATE(
 COUNTROWS(Audit_Readiness_v5_SP),
 FILTER(Audit_Readiness_v5_SP[Status] = "Complete" 
        || Audit_Readiness_v5_SP[Status] = "N/A"
       )
VAR _denominator = 
COUNTROWS(Audit_Readiness_v5_SP)

RETURN
_numerator/_denominator

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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