Forum Discussion

s_jay's avatar
s_jay
Frequent Visitor
9 years ago
Solved

Extract duration from date/time in different rows at different instances

Hello! I am new to this community so I apologize if there is any error in this post. I need to find difference between a number of rows and repeat it and then add all these difference values up. The...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi s_jay,

     

    >>I need it to store the difference between corresponding begin and end periods and that too only when Load_shedding column is 1 because I just need to record the load shedding period values.

    You can modify the table formula and add a condition to filter specific records:

    Table = CALCULATETABLE('Data_3 sites','Data_3 sites'[Tag]<>BLANK(),'Data_3 sites'[Load_Shedding]=1)

     

    >>Also, I was thinking of using pivot column to get sum, average, minimum and maximum of duration values per location or per day (as required) in query editor but I don't know how to do this in data view with DAX as I am very new to this. 

    The most simple way is turn on the total row, and drag other duration columns with different summary mode.

     

    Regards,

    Xiaoxin Sheng