0

I am trying to calculate the running total of a calculated field/measure by creating another calculated field/measure as I need this for further calculations.

using maybe as an illustration

=CALCULATE(
SUM(Transactions[actual]),
All(Transactions),
Transactions[month]<=EARLIER(Transactions[month])
)

will calculate a running total, but then when i try to create another running total of this calculated field it gives me an error.

"Calculation error in measure 'Date'[RunningTotal Of RunningTotal]: The SUM function only accepts a column reference as the argument number 1."

Anyone has any idea on how to do this?

jonleech
  • 461
  • 1
  • 6
  • 30
  • That sample cannot be a measure in your model. There is no row context for EARLIER() to refer to. If defined as a measure this would give an error. – greggyb Jan 10 '16 at 14:56
  • so in the SUM dax function there is no way i can use it to sum up calculated field/measure? – jonleech Jan 10 '16 at 15:15
  • That's not what I said. EARLIER() refers to an outer row context from within a nested row context. There is no row context in the measure as you've defined it. If you want a running total, you can use the example that I posted in your other thread, with a FILTER() as an argument to a CALCULATE(). Have you tried to work with the sample I gave you in your other thread? I can help you trouble shoot that with more details of your model and expected outcome, but if you keep asking the same question I can't do more than point you to the same answer. – greggyb Jan 10 '16 at 15:19
  • Apologies. Yes I did tried out the sample you gave me as I was already working with a calculated field that's why i hit the error "Calculation error in measure 'Date'[RunningTotal Of RunningTotal]: The SUM function only accepts a column reference as the argument number 1." – jonleech Jan 11 '16 at 03:53
  • No, do not use SUM() around your existing measure. Use CALCULATE( [Existing Measure], FILTER( ... ) ) – greggyb Jan 11 '16 at 04:13

0 Answers0