Forum Discussion
DAX formula for complex SQL nested table joins
Hi v-jiascu-msft,
Regarding the relationship portion, that is also one of my challenges because the VisitID is not unique in either of the two tables. So when I try to create a relationship, I am unable to do so. :(
Regarding providing some sample data, I have some concerns about that because the data that I work with contains personal health information for our patients. But I will try to explain the logic as best as I can.
Essentially what I am trying to do with the SQL query is to find the first (Top 1) appointment that occurs after first order was put in (hence the OrderDateTime) but before the following/next order was put in for that same patient (hence the NextOrderDateTime). i.e. The appointment "top 1" or "First" appointment that occurs between those two order dates.
I hope this explanation makes sense.
Thanks.
Hey isohawon,
this is why v-jiascu-msft asked for dummy data. Please consider to create a PBIX file that contains sample data, that easily allows to provide you the solution you are looking for.
Upload the pbix file to onedrive or dropbox and share the link.
Otherwise, you will "offload" the burden to create sample data to people trying to help ;-)
Regards,
Tom