Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Using IF and Calculate with Filters

I want to calculate a margin measure in terms of revenue for doing so i created grouped by tables for the level of detail of the project. however i want to be able to calculate this at business unit ...
  • amitchandak's avatar
    6 years ago

    Anonymous 

    Try like

    IF( [Z2] = 1, [Real/ProyAct] / calculate(SUM(BM_MargenesUPP[UPP-Ing-RealProyAct]),allexcept(BM_MargenesUPP,BM_MargenesUPP[NEGOCIO] )),
    
    IF([Z2] = 2,[Real/ProyAct] / CALCULATE(SUM(BM_MargenesGGBU[GGBU-Ing-RealProyAct])),[Real/ProyAct]/calculate(sum('BM_MargenesSG&A'[SG&A-Ing-RealProyAct]))
    ))