Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Duplicating rows with udpated data in Power Query

I'm trying to create a dataflow with power query for currency conversion rates. I have an excel file that has the rates I need, the issue is that the rates for the current month aren't updated until the end of the month and sometimes they're needed before that. What I'm trying to do is to use the rates for the latest month until they actually get finalized. So I'd like to duplicate all rows for the last month in the file, update the month columns by one month and keep the rates the same. Here's a sample of the data now:

 

Currency CodeFXDate_EoM     Date_BoM
AED0.251780930999999996/30/2024     6/1/2024
ANG0.516227868999999956/30/2024     6/1/2024
ARS0.00107883400000000016/30/2024     6/1/2024
AUD0.608499028999999976/30/2024     6/1/2024
AWG0.516572868999999996/30/2024     6/1/2024
BGN0.511291999999999976/30/2024     6/1/2024

 

And here's what I would like it to look like:

 

Currency CodeFXDate_EoM     Date_BoM
AED0.251780930999999996/30/2024     6/1/2024
ANG0.516227868999999956/30/2024     6/1/2024
ARS0.00107883400000000016/30/2024     6/1/2024
AUD0.608499028999999976/30/2024     6/1/2024
AWG0.516572868999999996/30/2024     6/1/2024
BGN0.511291999999999976/30/2024     6/1/2024
AED0.251780930999999997/30/2024     7/1/2024
ANG0.516227868999999957/30/2024     7/1/2024
ARS0.00107883400000000017/30/2024     7/1/2024
AUD0.608499028999999977/30/2024     7/1/2024
AWG0.516572868999999997/30/2024     7/1/2024
BGN0.511291999999999977/30/2024     7/1/2024

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Thanks for the reply from aj1973 , please allow me to provide another insight: 

     

    1. Filter last month’s data in power query.

     

    2. Copy the current table and modify the column names of the two columns of dates.

     

    3. Create custom column.

     

     

     

    4. Remove unnecessary columns.

     

    5. Append the copied table to the original table.

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Thanks for the reply from aj1973 , please allow me to provide another insight: 

     

    1. Filter last month’s data in power query.

     

    2. Copy the current table and modify the column names of the two columns of dates.

     

    3. Create custom column.

     

     

     

    4. Remove unnecessary columns.

     

    5. Append the copied table to the original table.

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you that's exactly what I needed. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      I'm not certain that link helps with the specific problem unless I missed something? I don't need a timestamp for changes, I'm hoping to copy some of the existing rows and append them to the existing table with an updated date. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Bumping this back up as the response doesn't solve my issue.