Forum Discussion
How to get previous raw value by group?
Hi. I hope you are well. please could you help me with this. I want to do this calculate column or measure in power bi
Ronrf095 , Assuming MT is measure, Try to use offset, You might need a better order by column. If need you can add one more column to order by
Last MT = CALCULATE([MT], OFFSET(-1, ALLSELECTED('Table'[Month Year Calc],'Table'[Customer Material], 'Table[File]'), ORDERBY('Table'[Filter],asc),KEEP,PARTITIONBY('Table'[Month Year Calc],'Table'[Customer Material])))
Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U
2 Replies
- amitchandak
Super User
Ronrf095 , Assuming MT is measure, Try to use offset, You might need a better order by column. If need you can add one more column to order by
Last MT = CALCULATE([MT], OFFSET(-1, ALLSELECTED('Table'[Month Year Calc],'Table'[Customer Material], 'Table[File]'), ORDERBY('Table'[Filter],asc),KEEP,PARTITIONBY('Table'[Month Year Calc],'Table'[Customer Material])))
Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U
- Ronrf095New Member
thanks! it works!