Forum Discussion

rnoyce's avatar
rnoyce
Frequent Visitor
8 years ago
Solved

Calculate time difference based on report filter

Hi all   I am struggling to work out how to create a measure that will do the following.  I have 2 columns - ArrivalDateTime and DepartureDateTime.  I need to calculate the difference between the t...
  • Anonymous's avatar
    Anonymous
    8 years ago

    HI rnoyce,

     

    >>But I don't know how to get MIN(WindowDate)?  It should come from the report filter that uses relative date filtering on DepartureDateTime

    Based on your requirement, you want to get the min range from filter, right?
    If this is a case, you can try to use minx/maxx and allselected function to get the specific date range.

     

    min_Date =
    MINX ( ALLSELECTED ( Table ), [DepartureDateTime] )
    
    max_Date =
    MAXX ( ALLSELECTED ( Table ), [DepartureDateTime] )
    

     

     

    Regards,

    XIaoxin Sheng