Hello all,
For the record, I'm a complete PP/DAX newbie. I'm starting to use it to analyze large (can be over 10 million rows) but extremely simple datasets (backtesting of investment strategies). I'm typically working with 1 single table, which looks like this:
[obsdate] | [strategy] | [parameter A] | [parameter B] | [pl_daily]
I've setup a cumulative total since inception using the following formula:
Now I'd like to calculate the Max of cum_pl for each day. I've tried using the same approach as above :
But apparently the MAX() function does not work with Measures. I've messed around with MAXX() but I'm not really sure I understand how it works. Can anyone help me out with that please?
I need this value to calculate the current drawdown (i.e. [current day's cumulative P&L] - [max of cumulative P&L to date]). Maybe there's another way to achieve that result?
Any suggestions are most welcome, thanks in advance for your help!
For the record, I'm a complete PP/DAX newbie. I'm starting to use it to analyze large (can be over 10 million rows) but extremely simple datasets (backtesting of investment strategies). I'm typically working with 1 single table, which looks like this:
[obsdate] | [strategy] | [parameter A] | [parameter B] | [pl_daily]
I've setup a cumulative total since inception using the following formula:
Code:
pl_cum=CALCULATE(SUM(tblSource[pl_daily]),FILTER(ALL(tblSource[obsdate]),tblSource[obsdate]<=MAX(tblSource[obsdate])))
Now I'd like to calculate the Max of cum_pl for each day. I've tried using the same approach as above :
Code:
pl_max=CALCULATE(MAX(tblSource[pl_cum]),FILTER(ALL(tblSource[obsdate]),tblSource[obsdate]<=MAX(tblSource[obsdate])))
But apparently the MAX() function does not work with Measures. I've messed around with MAXX() but I'm not really sure I understand how it works. Can anyone help me out with that please?
I need this value to calculate the current drawdown (i.e. [current day's cumulative P&L] - [max of cumulative P&L to date]). Maybe there's another way to achieve that result?
Any suggestions are most welcome, thanks in advance for your help!