Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Time difference between adjacent rows

OK - so I'm trying to do something with a table in PowerBI that I hope will be easier than trying in Excel!   I have a table which contains meeting start and end datetimes for a number of rooms.  ...
  • ZunzunUOC's avatar
    ZunzunUOC
    7 years ago

    Try with "," per ";"

     

    They are calculated columns and try with this code better:

     

    Dif = 
    var DStart=DIFDates[origStartDate]
    var DEnd=DIFDates[origEndDate]
    var Room=DIFDates[ROOM]
    var DBefore=CALCULATE(MAX(DIFDates[origEndDate]);FILTER(DIFDates;DIFDates[ROOM]=Room && DIFDates[origEndDate]<=DStart && DIFDates[origStartDate].[Day]=DIFDates[origEndDate].[Day] && DIFDates[origStartDate].[Month]=DIFDates[origEndDate].[Month] && DIFDates[origStartDate].[Year]=DIFDates[origEndDate].[Year]))
    return
    DATEDIFF(DBefore;DIFDates[origStartDate];MINUTE)/60

    Best Regards,
    Miguel

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