Dear Vijay,
As sriram stated, you need not to touch anything in the data marts level, you can achieve this in bex level.If you are trying formulate in excel level, it wont be dynamic as much as sometimes.
If i understood your problem clearly create to key figures for on-time delivery and filter with "0" and divide the value per your logic. It will be comfortable to do the logic in bex side.