Forum Discussion
newkingdom
7 years agoFrequent Visitor
Difference between last date and next one
Hi, I am completely new to power bi. I have a table with appointments for customers by their id. each id number can have multiple appointment dates.
i am trying to find the number of days since the last appointment the patient had and their next appointment.
Please tell me how I can achieve that. Thank you.
Hi,
Hope this helps.
5 Replies
- Ashish_MathurSuper User
Hi,
Share some data and show the expected result.
- newkingdomFrequent Visitor
data results id date id days from last appointment to today 101 8/20/2019 101 7 101 8/21/2019 102 32 101 8/22/2019 103 62 101 8/29/2019 102 8/24/2019 102 8/25/2019 102 9/26/2019 103 8/27/2019 103 8/28/2019 103 8/29/2019 103 10/30/2019 Something along the lines of this basically
- Ashish_MathurSuper User
Hi,
Hope this helps.
- newkingdomFrequent Visitor
Thank you so much. Just a a follow up though, some of the tables only had one date and so the numbers are huge, like 43000. How can I add the condition that if 2ndlastday does not exist, then do not subtract or maybe just return the date?