Forum Discussion
How to return a previous row within a report view
Hello Community,
I will appreciate contribution to this challenge I have been trying to figure how the return the previous row in my use cases in a Matrix view in the snipnet 2 shown below. I created a calculated column to return previous row in the table below (Previous Cost), But when I try to reuse the column in a Matrix view the previous row columns do not align with the cost column any longer see snipnet 2.
Thanks for your help
Samson.
- Anonymous5 years ago
Hey Greg ,
Thanks for the input , this is the current outcome, Things still not aligning but a big step.
Thank you,
Samson Eromonsei
2 Replies
- Greg_Deckler
Community Champion
Anonymous Seems like it would be something along the lines of:
Previous Cost (Measure) = VAR __CodeID = MAX('Table'[CodeID]) VAR __Date = MAX('Table'[Date]) VAR __Table = FILTER(ALL('Table'),'Table'[CodeID] = __CodeID && 'Table'[Date]<__Date) VAR __Previous = MAXX(__Table,[Date]) RETURN MAXX(FILTER(__Table,[Date] = __Previous),[Cost])- AnonymousNot applicable
Hey Greg ,
Thanks for the input , this is the current outcome, Things still not aligning but a big step.
Thank you,
Samson Eromonsei