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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Determine percentage hitting a target

Hi,

 

I'm looking to determine the percentage of people hitting a given target, which I need to be able to dynamically calculate depending on the date hierarchy. Here's a simplified example of my needs and the current DAX I have to calculate part of this:

 

Data:

DatePersonAppointment Status
01/05/2020RodComplete
02/05/2020RodNo Show
03/05/2020RodComplete
01/05/2020JaneComplete
02/05/2020JaneComplete
03/05/2020JaneComplete
01/05/2020FreddyNo Show
02/05/2020FreddyNo Show
03/05/2020FreddyComplete

 

DAX:

Success = CALCULATE(COUNTROWS(Data), Data[Appointment Status] = "Complete")

Total = COUNTROWS(Data)

Success Rate = DIVIDE([Success],[Total])

 

What I want to do:

Assuming a target of 50% success Rate, I want to acheive the following:

% of Count of Person where Success Rate >= 50%

 

So for the complete data set here it would be 66.67%, Rod and Jane (2 out of 3) hitting target.

For 02/05/2020 only it would be 33.3%, only Jane (1 out of 3) hitting target.

For reference, this is a simplified example explaining what I want to do, my actual data is millions of records.

 

I know this should be easy, but I'm going round in circles! Help

1 ACCEPTED SOLUTION
5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , GT need forced using all or all selected

 

Success = CALCULATE(COUNTROWS(Data), Data[Appointment Status] = "Complete")

Total = CALCULATE(COUNTROWS(Data),allselected(Data)) // OR CALCULATE(COUNTROWS(Data),allData))

Success Rate = DIVIDE([Success],[Total])

 

 

 

Please Watch/Like/Share My webinar on Time Intelligence: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
My YouTube Tips at: https://www.youtube.com/playlist?list=PLPaNVDMhUXGYrm5rm6ME6rjzKGSvT9Jmy

Appreciate your Kudos.

@amitchandak  Thank you for this! Happened to be exactly what I needed.

Anonymous
Not applicable

@amitchandak Thanks for your reply. How does that work with the mentioned target of 50%? I need to calculate the % of people hitting the target, this wouldn't do that.

Anonymous
Not applicable

@amitchandak I've actually partially figured this out, but I have another problem... I oversimplified.

 

This DAX works based on determining the count of Person:

CALCULATE(COUNT(Person),Filter(Data,[Succcess Rate] >0.5))

And it's then straightforward to divide over the total count.

 

But I actually want to roll up to team and that I'm really struggling with. Every iteration of Filter just returns the Person count not grouped by Team:

 

DateTeamPersonAppointment Status
01/05/2020ARodComplete
02/05/2020ARodNo Show
03/05/2020ARodComplete
01/05/2020AJaneComplete
02/05/2020AJaneComplete
03/05/2020AJaneComplete
01/05/2020BFreddyNo Show
02/05/2020BFreddyNo Show
03/05/2020BFreddyComplete

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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