Forum Discussion

newkingdom's avatar
newkingdom
Frequent Visitor
7 years ago
Solved

Next available day

Hi I have a patienid and dates. I want to choose the next earliest date. 

 

          
 patientid date  patietidnextdate  
 1 8/20/2019  19/21/2019  
 1 9/21/2019  29/26/2019  
 1 10/22/2019  39/28/2019  
 2 8/23/2019  48/30/2019  
 2 8/24/2019      
 2 10/25/2019      
 2 9/26/2019      
 3 8/27/2019      
 3 9/28/2019      
 3 9/29/2019      
 4 8/30/2019      
          
          

 

 

so in essence, find the earliest date which is greater than today

  • Hi newkingdom 

    1. Place Table1[patientid] in the rows of a table visual

    2. Create this measure and place it in the visual

    NextDate =
    CALCULATE ( MIN ( Table1[Date] ), Table1[Date] > TODAY () )

1 Reply

  • AlB's avatar
    AlB
    Community Champion

    Hi newkingdom 

    1. Place Table1[patientid] in the rows of a table visual

    2. Create this measure and place it in the visual

    NextDate =
    CALCULATE ( MIN ( Table1[Date] ), Table1[Date] > TODAY () )