Forum Discussion

drad2211's avatar
drad2211
Frequent Visitor
6 years ago
Solved

dax time difference help

Hi   I have a somewhat similar question. I have a table that has the following columns (ID, Time, Action) and I want to add a new column (I believe by making a DAX equation) that can show the time ...
  • v-diye-msft's avatar
    6 years ago

    Hi drad2211 

     

    1. Add the index column in power query

    2. Add the measure below:

    Measure = var a = CALCULATE(MAX('Table (2)'[Time]),FILTER(ALL('Table (2)'),MAX('Table (2)'[Action])="Out"&&[Index]<MAX('Table (2)'[Index])),VALUES('Table (2)'[ID]))
    Return
    DATEDIFF(a,MAX('Table (2)'[Time]),MINUTE)