Forum Discussion
TabathaN
6 years agoAdvocate III
Calculate 3rd Opening
Hello, I work for a medical practice and we are looking to create a table/matrix that shows the 3rd next opening on a providers schedule. I am at a loss on how to accomplish this and could really...
- 6 years ago
Hi TabathaN
Create three measures
Measure = MAX('Table'[Appointment Date]) 3rd Next Avail = CALCULATE ( MAX ( 'Table'[Appointment Date] ), TOPN ( 3, FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Scheduling Provider] = MAX ( 'Table'[Scheduling Provider] ) && FIND ( "Open", 'Table'[Appointment Status], 1, 0 ) > 0 ), [Measure], ASC ) ) 3rd Next New Patient = CALCULATE ( MAX ( 'Table'[Appointment Date] ), TOPN ( 3, FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Scheduling Provider] = MAX ( 'Table'[Scheduling Provider] ) && FIND ( "Open", 'Table'[Appointment Status], 1, 0 ) > 0 && 'Table'[Appointment Type] = "New Patient" ), [Measure], ASC ) )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
kentyler
6 years agoSolution Sage
OK
So if the user selects a Doctor who as 6 future openings, you want a single card that displays the date of the 3rd of those openings, but not the 1st or 2nd ?