Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Comparing cumulative YTD actuals vs full year forecasts.

I am comparing Cumulative actuals against forecasts (see screenshot) . I want to only show cumulative actuals up until the most recent month for which we have actuals. This is month 8 / August 2017 ....
  • Phil_Seamark's avatar
    8 years ago

    Hi Anonymous

     

    I think this calculated measure is pretty close.  Just use this code in place of yours.  I'd suggest you use date columns that are datetime rather than just a Month number.

     

     

    Cumulative Actuals = 
    VAR Good = 
    	CALCULATE (
    		SUM ( 'Dataset'[Amount]), 'Dataset'[Type]="Actuals",
    		FILTER (
    			ALL ('DateDim'[Date]),
    			'DateDim'[Date] <= MAX ( 'DateDim'[Date])
    		)
    	)
    VAR MaxDate = MAXX(FILTER('Dataset',NOT ISBLANK('Dataset'[Actuals_month])),RELATED(DateDim[Date]))
    	
    RETURN 
    	IF(MAX('DateDim'[Date]) <= MaxDate , Good)