Forum Discussion

IzuruWi's avatar
IzuruWi
Frequent Visitor
3 years ago
Solved

Optimize existing DAX measure

Hi All, Anyone can help me to optimize the below DAX Measure? It takes more time and affects the visualization loading. I have copied the text in the DAX measure below. Thanks you very much.   ...
  • ImkeF's avatar
    3 years ago

    Hi IzuruWi ,
    I am not used to using the contains function, but everything else looks like it should load fairly fast.
    In your case, I would recommed to add a "Sign"-column to your Accounts-table that shows either 1 or -1 according to the logic in your measure code.
    Then you can just do a:
    M =
    SUMX (
    VALUES ( DIM_ANALYTIC_STRUCT_ACCOUNT[YourNewSignColumn] ),
    CALCULATE ( SUM ( FACT_CONSOL_BALANCE_OL[BALANCE] ) ) * DIM_ANALYTIC_STRUCT_ACCOUNT[YourNewSignColumn]
    )