cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sy898661 Member
Member

How to create a % On Time measure

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?!

 

PBI 1.PNG     PBI.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
tejaswidmello Established Member
Established Member

Re: How to create a % On Time measure

Hi @sy898661 ,

 

I tried with your measure and it works perfectly.

 

I get this output:

Capture 3.PNG

Capture123.PNG

 

Dont know if this is what your output should look like. however your formula looks correct.

 

Thanks,

Tejaswi

View solution in original post

4 REPLIES 4
tejaswidmello Established Member
Established Member

Re: How to create a % On Time measure

Hi @sy898661 ,

 

I tried with your measure and it works perfectly.

 

I get this output:

Capture 3.PNG

Capture123.PNG

 

Dont know if this is what your output should look like. however your formula looks correct.

 

Thanks,

Tejaswi

View solution in original post

Highlighted
Super User
Super User

Re: How to create a % On Time measure

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?

Super User
Super User

Re: How to create a % On Time measure

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?

sy898661 Member
Member

Re: How to create a % On Time measure

@Cmcmahan @tejaswidmello 

 

I'm not sure what I changed but it started working!!! Haha 🙂

Thank you both for replying!

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 154 members 1,475 guests
Please welcome our newest community members: