Forum Discussion

Sandeep_1992's avatar
Sandeep_1992
Regular Visitor
1 year ago
Solved

Referring Same Column - Previous Value

Hi Everyone, 

 

Question : Can we refer to same column previous value in power bi calculated column ? Like in excel if i need to calculate a cell value i can refer to the cell value above and calculate the function is it possible here.

 

I tried to do it gives me circular dependency if i refer same column

 

Situation : I have these colums below - I need calculate if date is equals today then its value from a measure if date is > today then its should multiply same column previous value with ( Cycle time - 1) /(Cycle time+(New Offer - Amount - Column 1) )eg: Hot Leads Amount S. no one answer is equal to today date then it would be 66. but, Hot Leads S.No 2 - as its greater then today it should calculate HotLeads_Amount S.No 1 * 3 -1/ 3+New Offer_ Amount S.No

 

  Hot Leads New Offer 
S.NoDateOfferAmountOfferAmount
126.06.2025  4900099
226.06.2025  4900098
326.06.2025  4900097
426.06.2025  3050096
526.06.2025  3050094
626.06.2025  3050096
  • Hi Sandeep_1992 ,

    Thanks for reaching out to the Microsoft fabric community forum

     

    To help us understand your issue better, please share sample data that clearly shows the problem (in text or table format, not a screenshot), without including any sensitive or unrelated information, and also show the expected result based on that data. If possible, share the PBIX file as well, provided it doesn’t contain any sensitive information.

     

    Looking forward to your response.

     

    Best Regards,

    Lakshmi Narayana

     

8 Replies

  • It is possible to do this but your message in unclear to me

     

    Cycle time and Column 1 are not in the table you provided and the description is difficult to understand

     

    Pls provide all the tables and columns, including dates before and after today, and include examples of the calculation result you are looking for writing that in a more extensive way so I can help better and provide the answer

     

    Thanks

    • Sandeep_1992's avatar
      Sandeep_1992
      Regular Visitor

      Column 1 = which i mentioned is in the NewOffer_Amount S.no 1 as Column 1 the value is 99

      Cycle time = I dont have in the table its a static input like 3 months or 6 months i can be changed

       

      Below excel snapshot i want to build that in power bi - the formula i want is = =IF(AND(D24=$H$6;E24=$H$7);'ST'!$T$88;IF(OR(D24>$H$6;E24>$H$7);N23*($I$10-1)/$I$10+P23;0))

      D24 = Month

      E24 = Month

      ST T88 - I have a measure which gives this value lets say it 66

      N23 = Same Column above row ( For eg:- I'm calculating n24 its n23, n25 then its n24)

      I10 = Cycle time, which is again a measure value i want to add 

      p23 = last column in the excel newly generated per month fields - Amount Column ( This value also to be takne previous cell like for N24 it should take p23)

       

       

      • FBergamaschi's avatar
        FBergamaschi
        Super User

        If you copy and paste the table here so I can copy and put iit in power BI I can try

         

        Not pictures, copy the table in such a way I can use it

         

        Best

        FB

  • v-lgarikapat's avatar
    v-lgarikapat
    Community Support

    Hi Sandeep_1992 ,

    Thanks for reaching out to the Microsoft fabric community forum

     

    To help us understand your issue better, please share sample data that clearly shows the problem (in text or table format, not a screenshot), without including any sensitive or unrelated information, and also show the expected result based on that data. If possible, share the PBIX file as well, provided it doesn’t contain any sensitive information.

     

    Looking forward to your response.

     

    Best Regards,

    Lakshmi Narayana

     

    • v-lgarikapat's avatar
      v-lgarikapat
      Community Support

      Hi Sandeep_1992 ,

       

      If your issue has been resolved, please consider marking the most helpful reply as the accepted solution. This helps other community members who may encounter the same issue to find answers more efficiently.

      If you're still facing challenges, feel free to let us know we’ll be glad to assist you further.

      Looking forward to your response.

      Best regards,
      LakshmiNarayana.

      • v-lgarikapat's avatar
        v-lgarikapat
        Community Support

        Hi Sandeep_1992 ,

        If your issue has been resolved, please consider marking the most helpful reply as the accepted solution. This helps other community members who may encounter the same issue to find answers more efficiently.

        If you're still facing challenges, feel free to let us know we’ll be glad to assist you further.

        Looking forward to your response.

        Best regards,
        LakshmiNarayana.

         

  • Hi Sandeep_1992 

    In Power BI, when you try to create a table that simulates incremental changes (like ±5 steps) of a measure such as [Cost], it's important that the measure respects the filters applied in the report—especially date filters. In your original DAX expression, you define BaseCost as a variable outside of the row context of the ADDCOLUMNS function. This causes [Cost] to be evaluated once in a broader context, ignoring any filters such as dates selected by the user. As a result, the simulated cost values remain static regardless of the date slicer changes. To make the [Cost] measure respond to filters like dates, you need to calculate it inside the row context of the virtual table. This can be done by using the CALCULATE function within ADDCOLUMNS, which re-evaluates the [Cost] measure in the context of each row generated by GENERATESERIES. By moving the measure calculation inside and wrapping it with CALCULATE, you ensure that each simulated cost dynamically reflects the correct value according to the current report filters. This makes your simulation accurate and interactive, adjusting properly as users apply slicers or filters to the visual.