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
Clint
Helper V
Helper V

Calculating Percentage of Unique Count vs total count

Hello,

 

I need to calculate some KPI data based on how many projects have hit or will hit their Feature Complete date this quarter.  Essentially if a project has a 0 variance or less than 0 (meaning they are early, they have hit their metric.  If they have a variance greater than 0, they missed their metric.  I have created cards that show the total number of projects in the quarter, the ones that hit their metric and the ones that missed their metric.  What I'm not sure how to do is divide the hits by the total to get the overall metreic number (percentage).  I tried using countx -- FC KPO Results = COUNTX(Projects,Projects[FC Variance]<0)  -- to see if I could at least count the FC Variances that were 0 or less than 0 but it doesn't support boolean arguments.  Not sure how to get these two totals in a manner so I can do some math.  Any thoughts/guidance is appreciated.

 
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

A couple measures to build to this one but keep it clear.

 

Count the unique project ID's

 

Projects Count = DISTINCTCOUNT ( Projects[Project ID] )

 

 

Calculate the # of projects hitting their goal

 

Projects Hitting = CALCULATE( [Projects Count] , Projects[Variance] <= 0 )

 

 

 

Calculate the % hitting

 

% of Projects Hitting = DIVIDE( [Projects Hitting] , [Projects Count] , 0 )

 

 

 

 

 

 

 

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Without seeing your data and expected result, it is actually not possible to help you but try this measure

 

=COUNTROWS(FILTER(Projects,Projects[FC Variance]<0))

 

Projects is your table name and FC variance is a column in that table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish but this just returns the total number of projects in the quarter.  The filter doesn't seem to take effect.

jdbuchanan71
Super User
Super User

A couple measures to build to this one but keep it clear.

 

Count the unique project ID's

 

Projects Count = DISTINCTCOUNT ( Projects[Project ID] )

 

 

Calculate the # of projects hitting their goal

 

Projects Hitting = CALCULATE( [Projects Count] , Projects[Variance] <= 0 )

 

 

 

Calculate the % hitting

 

% of Projects Hitting = DIVIDE( [Projects Hitting] , [Projects Count] , 0 )

 

 

 

 

 

 

 

Thank you JD.  This worked great!

 

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.