Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217340

Power BI Calculated Column dependent on previous value of self

$
0
0

Hello,

 

I wonder if anyone could help with this calculation. I have a calculated table with the following fields among others: KeyId, Date, CumPnl.  Note that CumPnl is already a calculated column.

 

I would like to add a new calculated column Peak, where let's say for example that the equivalent excel formula for the current row i would be:  

 

Peak[i] := IF ( CumPnl[i] > Peak[i-1], CumPnl[i], Peak[i-1] )

 

The rows could be differenciated by date or key. 

 

I somehow cannot get the EARLIER() syntax right in conjuction with IF and the circular dependency.

 

Any ideas?

 

Many thanks,

 

Jose


Viewing all articles
Browse latest Browse all 217340

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>