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.
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())
)
Solved! Go to Solution.
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 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]) )
)
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.
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?
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.
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!
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
27 | |
20 | |
15 | |
12 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |