Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Ivo78
Regular Visitor

Calculating delivery performance

I am working on creating a report focusing on undelivered shipments. But now I'm getting stuck in the dax formulas and not getting my calculation right. First, I created the following measures to calculate the successful deliveries and undelivered shipments.
 
1 Delivery succesful = CALCULATE(COUNTROWS(Deliveries),FILTER(Deliveries,Deliveries[Status] = "i" ||Deliveries[Status]="O"||Deliveries[Status]="Z"))
 
2 Not deliverd = COUNTA('Deliveries'[DeliveryID]) - [Delivery succesful]
Then I made a measure for a delivery performance
 
delivery performance = DIVIDE(SUM(Deliveries[DeliveryID]),CALCULATE(SUM(Deliveries[DeliveryID]),ALL(Deliveries)))
 

 

 Updating Media
Only my calculation is not correct and it shows 100%. To get the focus on the undelivered shipments,
I actually want to calculate the percentage undelivered using the column not deliverd. But this dax measure won't work. Furthermore,
I thought to get a correct percentage I should make a measure with True or False but don't know how to make this formula.
 
I was curieus of my thoughts on the calculation are correct. And i woud be happy to hear wat i can improve to get  the calculation right.
 
20231102_195532.jpg

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Ivo78 ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure. 

delivery performance = 
var _a=[Delivery succesful]
var _b=[Delivery succesful]+[Not deliverd]
return DIVIDE(_a,_b,0)

(2) Then the result is as follows.

vtangjiemsft_0-1699256304228.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

Anonymous
Not applicable

Hi @Ivo78 ,

 

Please check this line of code. there is no ONWAAR() function in dax.

  'DeliveriesStatus'[Culpable]] = ONWAAR()

You can create this measure if you want to calculate the error percentage.

FalsePercentage = 
var _a=[Not deliverd]
var _b=[Delivery succesful]+[Not deliverd]
return DIVIDE(_a,_b,0)

vtangjiemsft_0-1699320761903.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Ivo78 ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure. 

delivery performance = 
var _a=[Delivery succesful]
var _b=[Delivery succesful]+[Not deliverd]
return DIVIDE(_a,_b,0)

(2) Then the result is as follows.

vtangjiemsft_0-1699256304228.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

Hi Neeko Tang

 

Thanks for youre help.

With thuis measure i can cleary see my % succesful deliveries. If i got right i can now get the correct % by maling a measure with true or false. I have search and created the following pleasure. Only i get a message chat the end of the input has been reached.

 

FalsePercentage =
VAR totalRows = COUNTROWS('DeliveriesStatus')
VAR falseRows =
  CALCULATE (
    COUNTROWS('DeliveriesStatus'),
    'DeliveriesStatus'[Culpable]] = ONWAAR()
  )

RETURN DIVIDE(falseRows,totalRows))))
 
Are my thoughts on the calculation correct? Or must i look for another solution.
20231106_194052.jpg

 

Anonymous
Not applicable

Hi @Ivo78 ,

 

Please check this line of code. there is no ONWAAR() function in dax.

  'DeliveriesStatus'[Culpable]] = ONWAAR()

You can create this measure if you want to calculate the error percentage.

FalsePercentage = 
var _a=[Not deliverd]
var _b=[Delivery succesful]+[Not deliverd]
return DIVIDE(_a,_b,0)

vtangjiemsft_0-1699320761903.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

Thanks for your reply . I am trying to generate a pbix file but I have not succeeded yet. I see I have to use Power-Bi Desktop for this? I also tried to send the table as excel but I don't see where I can upload it .

Anonymous
Not applicable

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.