Forum Discussion

laetitiaf's avatar
laetitiaf
Frequent Visitor
1 year ago
Solved

Data model or meaure issue causing visual has exceeded available resources error?

Hi, I am having an issue with after adding in credits to the data, making up about around 500k lines in total, query exceeds available resources when 10 Months+ are selected, I belive this may be ...
  • johnt75's avatar
    1 year ago

    You can halve the number of iterations needed by adding the discounts during the first iterations

    Sales =
    SUMX (
        'Invoices',
        ( 'Invoices'[Quantity] * 'Invoices'[Selling Price] ) + 'Invoices'[Discount]
    )
        + SUMX (
            'Credits',
            ( 'Credits'[Quantity] * 'Credits'[Selling Price] ) + 'Credits'[Discount]
        )
    

    Also, change GP to

    GP =
    CALCULATE ( ( [Sales] - [Cost] ), 'Invoices'[Transaction Type] = "drinv" )
    

    Never filter entire tables if you can avoid it, filter columns instead. Its much safer and much quicker.