Forum Discussion
crispybits77
2 years agoHelper I
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...
- 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
CoreyP
2 years agoSolution Sage
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
_logiccrispybits77
2 years agoHelper I
That worked thanks - got blinkered on getting the formula I had working instead of just seeing the obvious solution...
(aslo sorry for the delay replying - been off for christmas and only just getting back to work now)