Forum Discussion

bisartorelli's avatar
bisartorelli
New Member
3 years ago
Solved

Get Next Record for the same ID

Hi guys, I'm kinda new in PBI and need help with this logic.  I did something in M (following a youtube video), but its taking too long to join the tables and it is timing out in the service.   I...
  • lukiz84's avatar
    3 years ago

    Hi,

     

    2 calculated columns:

     

     

    Next Appointment :=
          CALCULATE(
              MIN(YourTable[Appointment]),
              FILTER(
                  YourTable,
                  YourTable[Customer Name] = EARLIER(YourTable[Customer Name]) && 
                  YourTable[Childs Name] = EARLIER(YourTable[Childs Name]) && 
                  YourTable[Appointment] > EARLIER(YourTable[Appointment])
              )
           )

     

     

    and

     

     

    Result := 
       IF(
          ISBLANK(YourTable(Next Appointment]),
          "No Rebook",
          "Rebook"
       )