Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi !
I have a table named ShipDetails that looks like this :
DROP | ON_TIME_DELIVERY | ORDERED_PRODUCT |
Client 1 - Order 1 | OK | Product 2 |
Client 1 - Order 1 | OK | Product 4 |
Client 2 - Order 1 | KO | Product 1 |
Client 2 - Order 1 | KO | Product 2 |
Client 2 - Order 1 | KO | Product 3 |
C1 - O2 | KO | Product 3 |
C1 - O3 | OK | Product 3 |
C1 - O3 | OK | Product 4 |
I would like to create a measure that count the percentage of on time delivery.
In order to do that, I have to count 1 if ON-TIME_DELIVERY is "OK" and 0 if it's "KO", FOR EACH DROP (and then divide by the number of distinct drops).
It's easy to do it for each row, but, here, rows of the same drop have to be counted only as 1.
How could I do it ?
(I tried several measures like this one but it doesn't work at all : On time delivery (%) = CALCULATE(SUMX(ShipDetails,IF(ShipDetails[ON_TIME_DELIVERY]="OK",1,0)),ALLEXCEPT(ShipDetails,ShipDetails[DROP]))/DISTINCTCOUNT(ShipDetails[DROP]))
Thank you for your help,
Regards,
Marion
Solved! Go to Solution.
Hi @Anonymous
Try this.
On time delivery (%) =
DIVIDE(
CALCULATE(
DISTINCTCOUNT( ShipDetails[DROP] ),
ShipDetails[ON_TIME_DELIVERY] = "OK"
),
DISTINCTCOUNT ( ShipDetails[DROP] )
)
Hi @Anonymous
Try this.
On time delivery (%) =
DIVIDE(
CALCULATE(
DISTINCTCOUNT( ShipDetails[DROP] ),
ShipDetails[ON_TIME_DELIVERY] = "OK"
),
DISTINCTCOUNT ( ShipDetails[DROP] )
)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
67 | |
65 | |
57 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |