I am trying to filter on just the maximum month of my dataset and using this:
(Year_Month = maximum ( Year_Month ))
then ('Y')
else ('N')
is not returning 'Y' for the maximum month...
Year_Month looks like this:
201811, 201812, 201901, 201902 etc.
I would create a new data item to store the maximum value of Year_Month (and call it MAX_Year_Month or something), and then filter using that.
And then you could create another data item with the formula
CASE WHEN Year_Month = MAX_Year_Month THEN 'Y' ELSE 'N' END
It looks like you just need to make sure it's looking for the maximum of the whole query.
if ( Year_Month = maximum ( Year_Month for report ) ) then ( 'Y' ) else ( 'N' )