The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
Hi @kmle ,
Assuming you have a table like this.
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)
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)
Hi @kmle ,
Assuming you have a table like this.
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)
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)
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
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
14 | |
13 | |
8 | |
8 |