Forum Discussion
Add custom column with previous values
- Anonymous2 years ago
Hi ero1
Did you use the code in power query? The code Greg_Deckler and i offered is used in power bi desktop, if you want to achieve this in power query you need to use the code i offered at 4th message.
In power query, create the following custom column.
Custom column1
=List.Max(Table.SelectRows(#"Changed Type",(x)=>x[City]=[City] and x[Date]=Date.AddMonths([Date],-1))[Value])Custom column2
List.Max(Table.SelectRows(#"Changed Type",(x)=>x[City]=[City] and x[Date]=Date.AddYears([Date],-1))[Value])replace the #"Changed type"with the last step name of your query.(Format:#"xxxxx")
If the solutions @Greg_Deckler and i offered help you solve the provlem, please consider to mark them as solutions
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, thanks for you reply, although I have to confess that I don't understand this decompresses binary data part. I tried to use the solution @Greg_Deckler posted, but so far I haven't been able to figure how to make it work. Perhaps you could tell me what part I'm missing.
Forgot to mention that the values you see in the Previous columns are there by requesstt of @Greg_Deckler in order to let him know what was the values I am trying to calculate.