Forum Discussion

duybachhpvn's avatar
duybachhpvn
Frequent Visitor
4 years ago
Solved

SUMX/SUMMARIZE optimization

Hi,    Does anyone know how to fine tune the below DAX measure? I need to be able to sum the result of the spending based on fields from 3 Dimension tables: Cost_Categories, SiteName and AreaTypeNa...
  • amitchandak's avatar
    4 years ago

    duybachhpvn , It is possible that you take actual fact in summarize and add all dimension columns

     

    like

     

    CALCULATE(
    SUMX(
    Addcolumns( SUMMARIZE(
    Actual,
    SiteName[SiteName],
    AreaTypeName[AreaTypeName],
    Cost_Categories,
    Cost_Categories[CostCategoryName],

    ),
    "Spends", SUM(Actual[Cost])
    ), [Spends])
    NOT(Cost_Categories[CostCategoryName] IN {"Subcon","Material", "Controller"})
    )