Forum Discussion

rtillery2000's avatar
rtillery2000
Frequent Visitor
8 years ago
Solved

Separate Rows in to days based on Start and end date/time

I Understand what I am asking may require setting up a new table in Power Bi. Example of current Data below. My goal is to determine the minutes offline and online for each individual day. As you ca...
  • v-jiascu-msft's avatar
    8 years ago

    Hi rtillery2000,

     

    Please check out the demo here

    1. Add a custom column like this.

    {Number.From([StartDate])..Number.From([EndDate])}

    2. Expand the custom column.

    3. Change its type to Date. (not datetime).

    4. Add a new column "NewStart".

    if ( [Temp] = [StartDate]) then [StartTime] else [Temp]

    5. Change its type to datetime.

    6. Add a new column "NewEnd".

    if ([Temp] = [EndDate]) then [EndTime] else [Temp] & #time(23,59,59)

    7. You can delete the old two columns. 

    Separate_Rows_in_to_days_based_on_Start_and_end_datetime

     

    Best Regards,

    Dale