Forum Discussion

B_Ed1978's avatar
B_Ed1978
New Member
3 years ago
Solved

totals help

Hi There I have a measure where if I don't have an actual I use a forecast, this measure works well at the monthly level , but I am not sure why I can't get my total to work.  Actuals - $8,335,806 (Jul to Oct), Forecast - $19,854,201 (Nov to Jun) Total should be $28,190,007 for col ACT/FCT

 

My formula is 

ACT / FCT =
var actuals = sumx('FY23 Data','FY23 Data'[ACT])
var forecast = sumx('FY23 Forecast','FY23 Forecast'[FCT])
var result = if(actuals=blank(),forecast,actuals)
return
result

 

Thanks All

 
  • Hi,

    I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

     

    ACT / FCT =
    SUMX (
        DISTINCT ( 'TableName'[Period Month] ),
        CALCULATE (
            IF (
                SUMX ( 'FY23 Data', 'FY23 Data'[ACT] ) = BLANK (),
                SUMX ( 'FY23 Forecast', 'FY23 Forecast'[FCT] ),
                SUMX ( 'FY23 Data', 'FY23 Data'[ACT] )
            )
        )
    )
    

     

     

4 Replies