Hi everyone! Need a bit of help from the Power query guru.
So, I'm trying to get the last order and the previous order dates by each customer
For example, we have a table
Date of order | Customer | Manager
------------------------------------------
01.01.2023 | Customer 1 | Bob
07.01.2023 | Customer 2 | John
15.01.2023 | Customer 1 | Bob
10.02.2023 | Customer 3 | Ann
14.02.2023 | Customer 1 | Bob
20.02.2023 | Customer 2 | John
21.02.2023 | Customer 2 | John
25.02.2023 | Customer 1 | Bob
And as a result, need to get the table like
Customer | Manager | last order | Previous order | Date Difference
-----------------------------------------------------------------------------
Customer 1 | Bob | 25.02.2023 | 14.02.2023 | 11
Customer 2 | Tom | 21.02.2023 | 20.02.2023 | 1
Customer 3 | Ann | 10.02.2023 | - | 0
Maybe someone knows how to get it... Its pretty simple to write in SQL, but in M I have no idea (
So, I'm trying to get the last order and the previous order dates by each customer
For example, we have a table
Date of order | Customer | Manager
------------------------------------------
01.01.2023 | Customer 1 | Bob
07.01.2023 | Customer 2 | John
15.01.2023 | Customer 1 | Bob
10.02.2023 | Customer 3 | Ann
14.02.2023 | Customer 1 | Bob
20.02.2023 | Customer 2 | John
21.02.2023 | Customer 2 | John
25.02.2023 | Customer 1 | Bob
And as a result, need to get the table like
Customer | Manager | last order | Previous order | Date Difference
-----------------------------------------------------------------------------
Customer 1 | Bob | 25.02.2023 | 14.02.2023 | 11
Customer 2 | Tom | 21.02.2023 | 20.02.2023 | 1
Customer 3 | Ann | 10.02.2023 | - | 0
Maybe someone knows how to get it... Its pretty simple to write in SQL, but in M I have no idea (