Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi all,
New to PowerBI but have a background in SQL.
I'm trying to show On Time Delivery %, in order to calculate that I need to know if a delivery was late or not.
What i need is a way to show if (Table1)[Delivered Date] is on or before (Table2)[Due Date].
What's the best way to go about this?
Solved! Go to Solution.
Hi @Nikon1177,
In your scenario, you need to create a calculated column to return [Due Date] from Table2. Then create another column to decide whether the delivery is late or not. See:
Due Date from Table2 = RELATED(Table2[Due Date])
Column = IF(Table1[Delivered Date]<=Table1[Due Date from Table2],"On-Time","Late")
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu
Hi @Nikon1177,
In your scenario, you need to create a calculated column to return [Due Date] from Table2. Then create another column to decide whether the delivery is late or not. See:
Due Date from Table2 = RELATED(Table2[Due Date])
Column = IF(Table1[Delivered Date]<=Table1[Due Date from Table2],"On-Time","Late")
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu
The way that I have done this in the past is quite simple.
Late Order Indicator = IF(Delivered Date>Due Date, "Late", "On-Time")
YOu may need to do some formatting of your dates, so you just have the date, and not the entire Timestamp. If you want to get a feel for how late something is, simply subtract the dates, to get the interval.
Once you get your indicator set, you can simply count the "On-Time"Orders, and divide by the total count of orders.
Another way to do this would be to do this:
Late Order Indicator = IF(Delivered Date>Due Date, 1,0) //1=Late 0=On-Time
To calculate the on-time %, you can sum the Late Order Indicator, assuming you have only 1 order record, per order, and then count the total number of orders (or Distinct Count).
Good luck...
Nate
The issue that I'm running into with this is that the two dates are on two differnt tables, the tables have an indriect relationship.
What I get when trying your suggested formula is "A single value for column 'delivered date' in table 'invoice_header' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
I thought that the indirect relationship that allowed them to be displayed on the table together would be enough, apparently it's not?
@Nikon1177 Are you creating a COLUMN?
I just quikly scanned this post but from what you are describing looks like you need a COLUMN and you are creating a MEASURE!
You are almost *certainly* going to want to add another table that is your "calendar table", and use that to tie your fact tables together.
So you have an invoice header. What is the other table? can you also post a pic of the data model?
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
86 | |
81 | |
70 | |
49 |
User | Count |
---|---|
143 | |
124 | |
107 | |
60 | |
55 |