Forum Discussion

Tony2021's avatar
Tony2021
Iron Contributor
May 13, 2021
Solved

Power Query - Start and End Dates

Hello,

 

I have a table with rates per company and a value per company.  

I want to extend the charges from a Start Date to an End Date. 

Can power query do this?

 

Please see attached. 

thank you.

  • Tony2021 Yes it can!

    Attached a PQ solution that perhaps needs some optimising, but it's totally dynamic. You can add companies and/or change the dates, and it will be reflected when you refresh the green table.

     

    To make it a bit easier, I added a column for the cost calculation to the raw data table. 

8 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Tony2021 Yes it can!

    Attached a PQ solution that perhaps needs some optimising, but it's totally dynamic. You can add companies and/or change the dates, and it will be reflected when you refresh the green table.

     

    To make it a bit easier, I added a column for the cost calculation to the raw data table. 

    • Tony2021's avatar
      Tony2021
      Iron Contributor

      Riny_van_Eekelen 

      I would like to ask you a follow up since you have great knowledge of PQ. The amount is set in my example but if I had another table with a list of values per month then how could I incorporate the "new values" and calculate a fee based on this "new amount".

       

      Kindly see pic attached.  

      grateful for your insight.

       

      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        Tony2021 That's very well possible. but it would be some guesswork without more information. How does that "other table" look like?

        If you have tables with matching company names, you can use the merge function(s) in PQ to create a table like the one in the example, and then build further with that one.

         

    • Tony2021's avatar
      Tony2021
      Iron Contributor
      Wow. YOu are quite talented with PQ. Thank you for your great assistance. Enjoy the day!

Resources