Forum Discussion

Tanuja_PBI's avatar
Tanuja_PBI
Regular Visitor
5 years ago

How to find out a date based on specific value in different column?

"Star date" column is the doctors appointment available date and "Begin time" column is the available appointment slot times. I need to find out the "date of 3rd available slot" 

4 Replies

  • PC2790's avatar
    PC2790
    Community Champion

    Hello Tanuja_PBI ,

     

    The requirement is not at all clear.

    What logic do you want to apply while getting the 3 appointment slot.

    Also, please share a sample dataset to understand the details like datatype etc.

  • Tanuja_PBI's avatar
    Tanuja_PBI
    Regular Visitor

    Hi, here is the sample data set with available appointment slots of different doctors. The logic we need to apply is, starting from today we need to find the next third avialbility slot date irrespective of doctors. 

     

    "Star date" column is the doctors appointment available date and "Begin time" column is the available appointment slot times.

     

    For example, from the sample data set, the Red marked box would be our 3rd available slot and Blue marked box would be our 3rd available slot date(which is required).

     

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Assuming you are going g to Promote Headers, and use Date.FromText on that date field, then it's a matter of where you want the results. A new column? A separate query? Are we filtering to just that row? Here is the formula to get the results:

     

    = let position = List.PositionOf(TableName[start_date], Date.From(DateTime.LocalNow()), Occurrence.First) + 2 in TableName[[start_date], [begintime]]{position}

     

    --Nate

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Tanuja_PBI ,

     

    Did you mean you want to combine date and time fields to create datetime field?

    Use & combine date and time. Try this

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.