Forum Discussion
Anonymous
4 years agoNot applicable
Duplicate Rows mutliple times basesd on Max Date for each Store ID
Hi, Hope you're safe and doing well! I'm trying to duplicate the max date row 4 times for each store ID. For example- Max date for Store name A is 4/21/2022. Now I want to duplicate this r...
- 4 years ago
Hi Anonymous ,
In this case you need to use Power query and do the following:
Duplicate the Query that you have and then add the following steps after your transformations:
- Group by:
- store_id
- Max of Invoice date and all rows
- Add a custom column with the following code:
= Table.Max([ALL ROWS], "Index.INVOICE_DATE")- Expand the custom column (be aware to not select the store and the invoice date
- Remove column ALL ROWS
- On the other query append the previous query 4 times:
- Disable the load from the AppendQuery
See result attach.
- Group by:
MFelix
Super User
4 years agoHi Anonymous ,
In this case you need to use Power query and do the following:
Duplicate the Query that you have and then add the following steps after your transformations:
- Group by:
- store_id
- Max of Invoice date and all rows
- Add a custom column with the following code:
= Table.Max([ALL ROWS], "Index.INVOICE_DATE")
- Expand the custom column (be aware to not select the store and the invoice date
- Remove column ALL ROWS
- On the other query append the previous query 4 times:
- Disable the load from the AppendQuery
See result attach.
- Anonymous4 years agoNot applicable
Thank you so much !! It's working perfectly fine.