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.
Hi!
I am trying to create a % On Time Delivery measure, but its not working. I have a column (ATS) that shows if an order is Early (negative number), On Time (0), or Late (positive number) by doing a DATEDIFF between planned and actual delivery date.
I have another column (ATS On Time) that is
=IF(Sheet[ATS] <= 0, 1, 0)
So it has a 1 if the status is Early or On Time, and a 0 if it is Late
I have another column (ATS Count) that is
=IF(NOT ISBLANK(Sheet[ATS]), 1, 0)
So it has a 1 if the row has an order status, and a 0 if it is blank
So I tried creating a measure (% On Time) that is
=DIVIDE(SUM(Sheet[ATS On Time]) , SUM(Sheet[ATS Count]))
but it is showing 100% when it definitely should be 50%. What am I doing wrong?!
Solved! Go to Solution.
Hi @sy898661 ,
I tried with your measure and it works perfectly.
I get this output:
Dont know if this is what your output should look like. however your formula looks correct.
Thanks,
Tejaswi
@Cmcmahan @Anonymous
I'm not sure what I changed but it started working!!! Haha 🙂
Thank you both for replying!
Hi @sy898661 ,
I tried with your measure and it works perfectly.
I get this output:
Dont know if this is what your output should look like. however your formula looks correct.
Thanks,
Tejaswi
The measure looks correct. It could be done in one step, without creating the extra tables, but it should work just fine.
Do you have an active slicer or filter that could be restricting the dataset?
There's also the possiblity that you are displaying the result as a whole number. .5 rounds up to 1, which would give you this behavior. If you add another late delivery to your data, does the measure drop to zero?
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 |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |