Forum Discussion
laetitiaf
1 year agoFrequent Visitor
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 ...
- 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.
johnt75
1 year agoSuper User
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.
laetitiaf
1 year agoFrequent Visitor
Absolute legend, apreciate the explaination for the changes, that works perfectly, thank you so much!