Forum Discussion

aflintdepm's avatar
aflintdepm
Icon for Helper III rankHelper III
2 years ago
Solved

Next Visit Type by Visit Date

I have a table of client visits and visit dates (all future).  There are multiple visit types that could be scheduled, but I would like to report what the next visit type is, not the when.   Here i...
  • gmsamborn's avatar
    2 years ago

    Hi aflintdepm 

     

    Would a measure like this help?

    Next Visit Type = 
    VAR _NextDate =
        CALCULATE(
            MIN( 'Table'[Visit Date] ),
            'Table'[Visit Date] > TODAY()
        )
    VAR _NextType =
        CALCULATE(
            MAX( 'Table'[Visit Type] ),
            'Table'[Visit Date] = _NextDate
        )
    RETURN
    	_NextType