Reputation: 61
I haven't found anything on this, but maybe someone has an idea. I want to calculate the running total of an amount, and then get a measure that allows to show it per month. This then should be multiplied by a value for that month.
The data I have is looking like this:
Now i want to get as result:
So, sum up the amounts and then calculate it with this months value. Is this possible as a measure? Thanks in advance for any help!
Upvotes: 2
Views: 890
Reputation: 27251
Here is one way to do it:
//amount_total measure calculates total amount
amount_total = SUMX(data, data[amount])
//value_total measure calculates total value
value_total = SUMX(data, data[value])
//amount_rt measure calculates running total multiplied by value
amount_rt =
VAR cur_date = MAX(data[date])
VAR rt = CALCULATE(
[amount_total],
FILTER(
ALL(data),
data[date] <= cur_date
)
)
RETURN rt * [value_total]
Result:
Upvotes: 1