Refer Preview Row for Subgroup | Power Query Challenge

Recently, Jacqueline, a long time follower of my blog reached out to me with an interesting question. She was trying to get the previous row value for subgroups of Data. I have already written about how to refer to previous row in Power Query but this one is different. Let me explain!     Consider this simple Data Nothing too complicated here!   The Problem I’d like to create a new column that references the Previous value for each category. The output should look like this.. How would you solve this using Power Query?     All you data jugglers out there, get going and post your M Code and a snapshot of the output in the comments.   Refer to Previous Row for each Subgroup – Solution   .        Automate repetitive data cleaning tasks using Power Query A comprehensive course to learn Power Query to automate all your mundane and repetitive data cleaning tasks in Excel or in Power BI   DOWNLOAD THE COURSE OUTLINE    |    ENROLL IN THE COURSE