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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Elisa112
Helper V
Helper V

Find most recent appointments of a certain type

Hi All

 

I am trying find the most recent meetings for a certain type of  appointment. For this KPI I need to find the number of days between each appointment. I have managed to rank appointments for each user but now I am stuck on how to find only certain types of meetings.  Here is a sample of the data 

 

Usermeeting IDmeeting typemeeting daterank
1112Personal01/02/20241
1113Personal03/02/20242
1132Personal04/02/20243
1110Combined31/01/20242
1130Combined30/01/20241
1115Assessment28/01/20241
94Personal15/01/20242
96Personal13/01/20241
922Combined01/02/20241
1864Assessment25/01/20241
1819Personal27/01/20242
1825Personal13/01/20241

 

I am only looking for the 3  most recent meetings of type personal only , so the output should look like this

 

 

User1st Most Recent2nd Most RecentDays diff3rd Most RecentDays diff
1104/02/202403/02/2024101/02/202402/01/1900
913/01/202415/01/20242  

 

thank you in advance

3 REPLIES 3
Elisa112
Helper V
Helper V

Thank you I realise my ranking is incorrect, so your solution did not work, I will keep trying!

Elisa112
Helper V
Helper V

Hi @amitchandak 

 

Thank you, the output I am getting is this

 

Elisa112_0-1707480187254.png

 

I used the bottom measure to find the most recent 3 meetings, which works well for some users and not others, i.e although all users have 3 meeeting or more the measure only pulls 3 in some cases.  Also the date format includes time, and I do not understand why.

Thanks in advance if you have any suggestions to resolve.

amitchandak
Super User
Super User

@Elisa112 , For the third  most recent you can use the index function , and for last date you can use offset to get diff

 

Bottom = CALCULATE(Max('Table'[meeting date]) KEEPFILTERS(INDEX(3, ALLSELECTED('Table'[User], 'Table'[meeting ID], 'Table'[meeting Date]),
ORDERBY([meeting Date], desc),, PARTITIONBY('Table'[User]) )))

 

Last meeting date = CALCULATE(Max('Table'[meeting date]) KEEPFILTERS(offset(-1, ALLSELECTED('Table'[User], 'Table'[meeting ID], 'Table'[meeting Date]),
ORDERBY([meeting Date], ASC),, PARTITIONBY('Table'[User]) )))

 

Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

 

Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.