Forum Discussion

qwaszx55's avatar
qwaszx55
Frequent Visitor
8 years ago

Extremely slow measures.

Having issues with my measures being so slow that the visuals won't even load when doing direct query. Oddly enough this seems a rather recent issue but that is neither here nor there as I need to learn to optimize my measures anyway.

 

In short I have a table with:

 

QTY, PRICE, WARRANTYFLAG , OSI_LEASEDFLAG, ITEMTYPE

 

To determine what we sell as "equipment" or "recurring" or "Labor" I use the following to total them up for "equipment":

 

Equipment =
Calculate(
sumx (QuoteItem,QuoteItem[QTY]*QuoteItem[PRICE]),
filter( QuoteItem, QuoteItem[WARRANTYFLAG] <> "Y" && QuoteItem[OSI_LEASEDFLAG] <> "Y" && QuoteItem[ITEMTYPE] <> "L")
)

 

There has to be a faster measure as it is dog slow.

1 Reply

  • popov's avatar
    popov
    Resolver III

    Hi, qwaszx55

     

    Try this formula 

    Equipment =
    SUMX (
        FILTER (
            QuoteItem,
            QuoteItem[WARRANTYFLAG] <> "Y"
                && QuoteItem[OSI_LEASEDFLAG] <> "Y"
                && QuoteItem[ITEMTYPE] <> "L"
        ),
        QuoteItem[QTY] * QuoteItem[PRICE]
    )