Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
newkingdom
Frequent 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. 

1 ACCEPTED SOLUTION

Hi,

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
newkingdom
Frequent Visitor

 data   results    
          
 iddate  iddays from last appointment to today
 1018/20/2019  1017   
 1018/21/2019  10232   
 1018/22/2019  10362   
 1018/29/2019       
 1028/24/2019       
 1028/25/2019       
 1029/26/2019       
 1038/27/2019       
 1038/28/2019       
 1038/29/2019       
 10310/30/2019       
          

 

 

Something along the lines of this basically

Hi,

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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])


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.