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

Help with calculating percentage

Hi Guys,

 

Wanted some help with a dataset I'm currently working with (table name - FeatureProgress):

 

Capture.JPG

 

 

 

 

 

 

 

I'm trying to calculate the percentage of completed work for the 'Title' column. 

In this example the total sum of descendants = 29, and there are 21 of those in a Descendants.State of 'Done'.

So trying to figure out how I get the 0.724 answer 🙂 

 

Any thoughts?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Got it!

 

Answer is:

%complete = DIVIDE(CALCULATE(SUM(FeatureProgress[Descendants.Count]),FeatureProgress[Descendants.State] = "Done"), CALCULATE(SUM(FeatureProgress[Descendants.Count])))

View solution in original post

9 REPLIES 9
mussaenda
Super User
Super User

Hi @Anonymous,

 

I think you will need the function ALL on the second part of your statement

like  divide(sum(Descendants.Count), calculate(sum(Descendants.Count), all(your tablename))

 

Hope this helps

Anonymous
Not applicable

Sorry not quite clear on what the measure should be, are you saying it should be:

PercentageComplete = DIVIDE(CALCULATE(SUM(FeatureProgress[Descendants.Count])),CALCULATE(SUM(FeatureProgress[Descendants.Count]),ALL(FeatureProgress),FeatureProgress[Descendants.State] = "Done"))

 

 

@Anonymous 

 

change your denominator and numarator inside the divide function.

Anonymous
Not applicable

Got it!

 

Answer is:

%complete = DIVIDE(CALCULATE(SUM(FeatureProgress[Descendants.Count]),FeatureProgress[Descendants.State] = "Done"), CALCULATE(SUM(FeatureProgress[Descendants.Count])))

Hi @Anonymous,

 

Like this?

 

Untitled.png

 

% = DIVIDE(SUM(FeatureProgress[Descendants.Count]), CALCULATE(SUM(FeatureProgress[Descendants.Count]), ALL(FeatureProgress)))

Sorry I didn't read that you only need for DONE.

Try this:

% for Done = 
CALCULATE([%], 'FeatureProgress'[Descendants.State] IN { "Done" })

 

Hope this helps

Anonymous
Not applicable

Sorry that still doesn't work for me:

 

Screenshot (325).png

Well then,

I hope the experts here would be able to help you.

 

Sorry for not able to help you solve your problem.

amitchandak
Super User
Super User

@Anonymous , Try a new measure like

divide(calculate(sum(Table[descendants.count])),calculate(sum(Table[descendants.count]),table[descendants.state]= "Done"))

Anonymous
Not applicable

Thanks for the quick reply! That doesn't look to be quite right:

 

Screenshot (324).png

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.