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

Work Order Completion Percentage by Type

I have a table that has several different work types (All WO (Open and Closed)'[Work Type]) and I have a date column of date of completion (All WO (Open and Closed)'[Actual Completion Date]). I'm trying to find the percentage of Work Types that have complete date values as opposed to blank values. I've been pulling my hair out over this one. I created a measure that simply gave all blanks. I tried again and it counted everything even though I told it to exclude blanks. Below is code I found on this forum that I modified to meet my needs. Either it isn't what I'm looking for, or, I did it wrong. 

 

 

Measure = 
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), Table[CustomerName] <> BLANK(), Table[Country]="USA"),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), Table[CustomerName] <> BLANK())
)

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

divide( [A], [B] ) and the percent sign you get by formatting the expression. Use the formatting option on the ribbon. You should not multiply the expression by 100.

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Anonymous , not sure but Open % should be like

 

open % =
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), isblank(Table[[Actual Completion Date])),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table) )
)

open % =
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), (Table), isblank(Table[[Actual Completion Date])),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]) )
)

 

 

closed % =
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), not(isblank(Table[[Actual Completion Date]))),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table) )
)

closed % =
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), (Table), not(isblank(Table[[Actual Completion Date]))),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]) )
)

Anonymous
Not applicable

I've used the simpler one as my solution, but I'm definitely going to try this as well. I'm trying to learn and get better at Power Bi. So many sources of information and free training out there. 

Anonymous
Not applicable

I did figure a way to create a measure to count blank cells and a measure to count non blank cells. How would I use those to get a percentage?

Anonymous
Not applicable

divide( [A], [B] ) and the percent sign you get by formatting the expression. Use the formatting option on the ribbon. You should not multiply the expression by 100.

Anonymous
Not applicable

Thank you. I don't know why I didn't think of that. It was part of my first try at doing all this before doing counts. Much appreciated!

Anonymous
Not applicable

You have not shown the structure of your model, so it's hard, if at all possible, to tell you what's wrong. From the formula you've given it looks like you're trying to calculate the different customer names in UAS which are not blank (why should you have blank customer names?), then the same but for all countries and then make a ration out of it. It does not seem to be what you want: "I'm trying to find the percentage of Work Types that have complete date values as opposed to blank values."
Anonymous
Not applicable

That's a formula I found here in the forums that I replaced with my table names and such. I may have forgotten to mention that. Work types will never be empty but completed dates can be. I want to calculate the amount of work types with completed dates as a percentage of all work orders completed against work orders with no completion date entry. 

snoh8r_1-1597852028813.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.

Top Solution Authors