Forum Discussion

BIanon's avatar
BIanon
Icon for Helper V rankHelper V
3 years ago

Most efficient way to identify and multiply

Hello Community,

I have a table which looks like this(dummy data):

TripIdPurchaseIdUserIdValueFactor
10001100150001562,3
10001100250001652,3
10001100350001652,3
10001100450001322,3
10002100550011111,8
1000210065001981,8
1000210075001641,8
10002100850011541,8
1000210095001551,8

 

The real table also contains more data points than just 'Value'.

For every calculation I need to multiply any value by the 'Factor' value.

Currently I am using a measure like this:

 

 

SUMX('Table', 'Table'[Value] * 'Table'[Factor])

 

 


I am searching for a more efficient way to achieve this.

I need to have the 'raw' data and pre-calculating these fields would bloat my model past the 1 GB limit unfortunately.

I also have a different situation where I need to sum the Factor column but only include the value once per TripId which I am currently achieving like this:

 

 

SUMX(VALUES('Table'[TripId]), CALCULATE(MAX('Table'[Factor])))

 

 

iI am experincing particularly slow performance with this last one and am wondering if there is a more efficient way to arrive at the factor as a scalar


2 Replies

  • BIanon , Both seem correct

     

    If file permits create a column in power query or dax

    'Table'[Value] * 'Table'[Factor]

     

    and then do simple sum

    • BIanon's avatar
      BIanon
      Icon for Helper V rankHelper V

      Thank you for your response.

      Unfortunately this bloats my model a lot and adding factored columns like this while keeping the raw data (which I need to keep) would push me past the 1 GB limit.