Forum Discussion

Dain's avatar
Dain
Frequent Visitor
8 years ago
Solved

Date time filter,throughput,percentile

Hello All,   Back again.:)   I have a table with a column having a date time value.   Submit time   5/02/2018 19:23:09 5/02/2018 19:50:00 5/02/2018 20:50:00 5/02/2018 20:57:00 5/02/2018 2...
  • v-yuta-msft's avatar
    8 years ago

    Hi Dain,

     

    Use DAX below to create two calculate column Date and Time using column DateTime and then create two slicers based on the two calculate column.

    Date = DATE(YEAR(Table1[DateTime]), MONTH(Table1[DateTime]), DAY(Table1[DateTime])) 
    Time = TIME(HOUR(Table1[DateTime]), MINUTE(Table1[DateTime]), SECOND(Table1[DateTime])) 

    Then create a measure to calculate the throughput per hour using DAX like this:

    Result = 
    VAR Total = CALCULATE(SUM(Table1[throughput ]), ALLSELECTED(Table1)) 
    VAR Distance = DATEDIFF(CALCULATE(MIN(Table1[Date]), ALLSELECTED(Table1)), CALCULATE(MAX(Table1[Date]), ALLSELECTED(Table1)), HOUR) + DATEDIFF(CALCULATE(MIN(Table1[Time]), ALLSELECTED(Table1)), CALCULATE(MAX(Table1[Time]), ALLSELECTED(Table1)), HOUR)
    RETURN
    Total / Distance

    The result is as below and PBIX here: https://www.dropbox.com/s/mhxn3259pp9yb2m/Date%20time%20filter%2Cthroughput%2Cpercentile.pbix?dl=0

     

     

    Regards,

    Jimmy Tao