Forum Discussion

sai1995's avatar
sai1995
Icon for Microsoft Employee rankMicrosoft Employee
5 years ago

DAX

 My requirement is to create a measure that calculate value on previous value of other measure. 
Below is the example of excel that need to be replicated in power bi:

column b = column a(1)-column a(2)
Column a
-3.110723179 Column b
-0.873789535 2.236933644
1.740692298 2.614481833
-1.41959625 3.160288548

 

3 Replies

  • sai1995 

    I am not sure if you are trying to perform a recursive calculation here, your example is not clear to me.
    Please refer to below article from Greg_Deckler if it could be of use for you.

     

    https://gregdeckler.com/2019/03/06/previous-value-recursion-in-dax/

     

    ________________________

    If my answer was helpful, please click Accept it as the solution to help other members find it useful

    Click on the Thumbs-Up icon if you like this reply 🙂


    Website YouTube  LinkedIn

    • sbasant13's avatar
      sbasant13
      New Member

      Hi Fowmy,

      Let me explain the exact issue and need: 

      This is a sceen shot from excel that need to be replicated in power bi. The first field is also a measure and can't be converted to calculated column, need to create second field (measure) that calculate previous value - current value. From the screen shot: 

      Record 1: (blank) - (-3.11) = blank

      Record 2: -3.11 - (-0.87) = -2.23

      and so on. 

      I Tried Earlier function but it works only with columns. 

    • sai1995's avatar
      sai1995
      Icon for Microsoft Employee rankMicrosoft Employee

      Hi Fowmy,

      Thank you for your replay

      Let me explain the exact issue and need: 

       

      This is a sceen shot from excel that need to be replicated in power bi. The first field is also a measure and can't be converted to calculated column, need to create second field (measure) that calculate previous value - current value. From the screen shot: 

      Record 1: (blank) - (-3.11) = blank

      Record 2: -3.11 - (-0.87) = -2.23

      and so on. 

      I Tried Earlier function but it works only with columns.