Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jrojasuk
Regular Visitor

Power BI Calculated Column dependent on previous value of self

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

1 REPLY 1
v-haibl-msft
Employee
Employee

@jrojasuk

 

I don’t think we can do it with DAX. We can use EARILER to reference previous values in others existing columns but cannot do the same thing in self calculated column.

 

Best Regards,

Herbert

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors