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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

@Anonymous , percent of subtotal may help you there

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@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

@Anonymous , percent of subtotal may help you there

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.