Thanks for reaching MS Q&A
Here’s a high-level overview of how you can achieve this:
Source Transformation: Connect to your source data.
Window Transformation: Add a window transformation after your source transformation. In the window transformation, you can use the lag function to create a new column that contains the previous state. For example, you could create a new column PreviousPresence with the expression lag(Presence, 1).
Derived Column Transformation: Add a derived column transformation after the window transformation. In this transformation, create a new column StateChanged with the expression Presence != PreviousPresence. This will give a boolean value indicating whether the state has changed compared to the previous row.
Filter Transformation: Add a filter transformation after the derived column transformation. In the filter transformation, filter the rows where StateChanged is true. This will keep only the rows where the state has changed.
Sink Transformation: Connect to your destination data store and write the result.
please go through: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-window-functions
Hope this helps. Do let us know if you any further queries.