Forum Discussion

crispybits77's avatar
crispybits77
Helper I
2 years ago
Solved

Filtering by Date Table Wonkiness

Hi all   Having some trouble getting a measure to work how I want. The end goal is for an attendance to date for the year graph for a group of 3 schools similar to this:   The 3 part li...
  • CoreyP's avatar
    2 years ago

    What if you try adding a clause to only do the calculation if the date is on or before today? You might need to adjust this code, but something like this?

     

    AttendYTD%Day = 
    VAR _selecteddate = MAX( 'Primary Date Table'[Date] )
    VAR _measure =
    CALCULATE (
       'Attendance Calcs'[%Att],
    FILTER (ALL('Primary Date Table'[DayOrder]),
       'Primary Date Table'[DayOrder] <=
    MAX('Primary Date Table'[DayOrder])
        )
    )
    VAR _logic = IF( _selecteddate <= TODAY() , _measure , BLANK() )
    
    RETURN
    _logic