Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
Solved! Go to Solution.
Hi,
Hope this helps.
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
Hi,
Hope this helps.
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?
Hi,
Try this measure
=IF(ISBLANK([Second last date]),BLANK(),[Days since previous appointment])
Hi,
Share some data and show the expected result.
User | Count |
---|---|
98 | |
90 | |
83 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |