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
Anonymous
Not applicable

Help: How to calculate Rate?

I am working with Success Rate:

  • cntd_suc_rate_p = format([cntd_suc]/[cntd],"0.0%")
  • cntd_suc = CALCULATE([cntd],'f_table'[project_status]="Successful")
  • cntd = DISTINCTCOUNT('f_table'[proj_id])

 

When "Successful" is selected (in [project_status]), the Rate is fine, e.g.

2.PNG

 

But, if "Successful" is not selected, then get anomalies for the Rate values, e.g.

2b.PNG

or

2c.PNG

 

I think this problem is casued by the DAX expresssion that only works with "Successful" no matter it is selected or not:

  • cntd_suc = CALCULATE([cntd],'f_table'[project_status]="Successful")

 

How should I change the DAX expression for the following logic?

  • Success Rate = (# of successful projects) / (# of projects)
1 ACCEPTED SOLUTION
JarroVGIT
Resident Rockstar
Resident Rockstar

If you unselect 'Succesfull'  as filter, what number do you want to see then? Because if you uncheck 'Succesfull', I would expect you want cntd_suc to be 0. 

Change your cntd_suc into this:

 

cntd_suc = CALCULATE([cntd],FILTER(f_table; 'f_table'[project_status]="Successful"))

 

This returns the count of succesfull projects based on applicable filters. The applicable filters in your example are:

1. The slicer and its values, and;

2. The context of the visual, so for example the Year in your example.

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Kudo's are welcome 🙂





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
JarroVGIT
Resident Rockstar
Resident Rockstar

If you unselect 'Succesfull'  as filter, what number do you want to see then? Because if you uncheck 'Succesfull', I would expect you want cntd_suc to be 0. 

Change your cntd_suc into this:

 

cntd_suc = CALCULATE([cntd],FILTER(f_table; 'f_table'[project_status]="Successful"))

 

This returns the count of succesfull projects based on applicable filters. The applicable filters in your example are:

1. The slicer and its values, and;

2. The context of the visual, so for example the Year in your example.

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Kudo's are welcome 🙂





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

Proud to be a Super User!




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.

Top Solution Authors