Forum Discussion

Pastrupgaard's avatar
Pastrupgaard
Helper I
8 years ago
Solved

Grand total wrong when using =IF formula

Hey guys. I’m new to Power BI and I’ve encountered a problem I can’t seem to fix. I’m not at liberty to post the actual numbers or a picture of the connections (everything should be connected though)...
  • GregoryMartin's avatar
    8 years ago

    Hi Pastrupgaard

     

    It seems you forgot a part in your formula. You wrote this one:

    Estimate ($) = (if(sum(f_sales_forecast[Forecast])=0;sum(f_sales[Actual]);sum(f_sales_forecast[Forecast])))

     

    But if you want the sum of Actual + Forcast, you should write something like:

    Estimate ($) = (if(sum(f_sales_forecast[Forecast])=0;sum(f_sales[Actual]);sum(f_sales_forecast[Forecast])+sum(f_sales[Actual])))

     

    and it will give you your Grand Total