Forum Discussion
Datediff with Many to Many Relationship
Hi All,
I am struggling to get the number of calender days between two dates using the datediff function with aggregation. I have done similar thing in the past but the tables had one to many relationship (https://community.powerbi.com/t5/Desktop/Enquiry-Response-Time-using-Datediff-where-the-Dates-are-in/m-p/1009183#M478038). Attached is some sample data.
I am trying to calculate how late or early a SO line was delivered. If a SO line was delivered in two different batches i.e. not delivered in full, then we are using the latest date for calculation as can be seen for SO A and Line 1.
Thanks for your help!!!
4 Replies
- Greg_Deckler
Community Champion
You can't create a composite key using [So No] & [So Line No] ?- HabibAdil
Helper IV
Hi Greg_Deckler Thanks for your quick response. I tried that, but SO No is a string and SO Line is a whole number. I get an error. The SO NO is not always a number, but could have characters, hence I cannot change it to a number.
- Greg_Deckler
Community Champion
I'm not sure what the issue is HabibAdil I have attached an example file where I concatenate a text column and a numeric column.