Hi All,
I'm attempting to filter some of my data and I'm having problems getting it correct. I'm pulling my data in from SQL and cleaning in up in power query before visualizing it in Power BI. This is data of sales orders captured in our system which, over time, might have modifications made to them resulting in our system archiving off the older versions and applying a version number to each row of data. Each sales order has it's own unique number (Sales Order Number) which can have multiple rows of data (a row for each item on the sales order) and, as a result of the archiving process, each row will have a Version number.
I need to be able to extract all rows of a Sales Order Number which match the max value of the Version.
A rough example of the data I'm pulling is below.
<tbody>
</tbody>
And here is an example of how I need this data to be transformed.
<tbody>
</tbody>
Any help is appreciated!
I'm attempting to filter some of my data and I'm having problems getting it correct. I'm pulling my data in from SQL and cleaning in up in power query before visualizing it in Power BI. This is data of sales orders captured in our system which, over time, might have modifications made to them resulting in our system archiving off the older versions and applying a version number to each row of data. Each sales order has it's own unique number (Sales Order Number) which can have multiple rows of data (a row for each item on the sales order) and, as a result of the archiving process, each row will have a Version number.
I need to be able to extract all rows of a Sales Order Number which match the max value of the Version.
A rough example of the data I'm pulling is below.
SALES ORDER NUMBER | VERSION | ITEM |
10000 | 1 | Item 1 |
10000 | 1 | Item 2 |
10000 | 1 | Item 3 |
10000 | 2 | Item 1 |
10000 | 2 | Item 2 |
10000 | 2 | Item 3 |
10000 | 3 | Item 1 |
10000 | 3 | Item 2 |
10000 | 3 | Item 3 |
10001 | 1 | Item 1 |
10001 | 2 | Item 1 |
10002 | 1 | Item 3 |
10003 | 1 | Item 2 |
10003 | 1 | Item 4 |
10003 | 2 | Item 2 |
10003 | 2 | Item 4 |
<tbody>
</tbody>
And here is an example of how I need this data to be transformed.
SALES ORDER NUMBER | VERSION | ITEM |
10000 | 3 | Item 1 |
10000 | 3 | Item 2 |
10000 | 3 | Item 3 |
10001 | 2 | Item 1 |
10002 | 1 | Item 3 |
10003 | 2 | Item 2 |
10003 | 2 | Item 4 |
<tbody>
</tbody>
Any help is appreciated!