I want to retrieve previous row Net Price for same article code and compare it with present row netprice and store the prevnetprice and calculate the price change. need to store the price change and MRINDate (PODATE) of change

i want to retrieve previous row Net Price for same article code and compare it with present row netprice and store the prevnetprice and calculate the price change. need to store the price change and MRINDate (PODATE) of change. if only 1 row of Article code the compare the netPrice with MaterUnitPrice and store the change in price and MRINDate of change

i have sorted the original table on ArticleCode and MRINDate . Tried using DAX and power query, but unable to compare the currentrow NetPrice with PrevRowNetPrice

Articlecode NetPrice MRINDate MasterUnitPrice

1-101-100 10.00 10 aug 2022 11
1-101-101 .06 11dec 2022 1.0
1-101-101 1.2 21dec 2022 2.2
1-101-101 .07 1 jan2023 1.0
1-101-101 .09 12jan2023 .06

result i require is added columns in the same row
price Change MRINDATE of change
-1.00 10aug2022
-9.94 11dec2022
+1.14 21dec2022
-1.13 1jan2023
+.02 12jan2023

if no change then price change is 0 and MRINDate of change is null or blank
cost21Sept’23withSortedTableRestInBiWorkingPerfectSORTORDERING.pbix (294.0 KB)

I have solved this by creating IndexCol, but indexcol values are jumping after 14 ( to 30) and after 28-29 ( to 60), i checked the data, i didn’t find any discrepancy, enclosing the revised pbix
DNAcost22SeptCORRECTtPrevNetPriceDAX—workingonIndexColValues.pbix (212.5 KB)

please make sure you mark the posting as solved ty

this problem is sttill open, i am unable to get proper valuse in IndexCol
articlecode mrindate expected IndexColValue
100 20aug2022 1
101 1 march2022 1
101 20Aug 2022 2
101 20Aug 2022 3
101 2Dec2023 4
102 5May2023 1
102 15June2023 2
and so on

the present code is jumping IndexCol Value

I kinda remember something similar within the forum related to the previous row but i can’t find it… Did you search the forum/youtube or even ask Chatgpt?

Thanks sir, I was trying chatgpt for last 2-3 days but…not able to resolve the issue.
Actually i have a column [ netprice] of articlecode on each [ mrindate] . I need to find prevrow netprice and compare with current row net price. Trying with chatgpt but unable to solve

Please close this thread as you have opened another. You only need to open one occurrence.

thanks
Keith

my problem of indexcol is still unsolved

you open another topic with the same kind of topic you can’t have two the same topic open

problem is still unresolved, i am closing