+ Reply to Thread
Results 1 to 3 of 3

Excel power query - dynamic range data fill-in

  1. #1
    Registered User
    Join Date
    10-28-2019
    Location
    Brussels, Belgium
    MS-Off Ver
    Office 365
    Posts
    21

    Excel power query - dynamic range data fill-in

    Hi everyone!

    I have a specific problem that I was asked to complete using power query only - I have arrived at a solution myself but it feels slow & uses a lot of power query steps, so I was wondering if some brilliant mind could take a look and suggest an easier approach.

    (excel file attached)

    There are 3 columns:

    F ID
    Total amount
    Year of deal

    The years span from 2007 to 2021 - a F ID can have one, several or no values (total amount) in a certain year.

    My desired output would be a list that contains the sum of total amount by year of deal for each fund ID, BUT in cases where there is no total amount in a certain year, the row would be "0".

    My solution (see power query window in the attached excel):

    - group initial table by year & amount
    - pivot year column (transposed years on multiple columns)
    - replace "null" with "0" on all newly-created years columns
    - unpivot the year columns back

    It -does- do what I need it to do, however in my opinion it's not an ideal approach - any thoughts as to how I can end up at the final result easier?

    Many thanks!!
    S
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Excel power query - dynamic range data fill-in

    instead of Power Query you can try standard Pivot Table

    pt.png

    and you can choose what you want to show
    Last edited by sandy666; 08-30-2022 at 07:55 AM.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel power query - dynamic range data fill-in

    "BUT in cases where there is no total amount in a certain year, the row would be "0"."

    Option for pivot table (right mouse click) => layout and format => show for empty cells => Fill in whith 0.

    See the attached file.
    Last edited by oeldere; 08-30-2022 at 10:00 AM.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 03-26-2021, 10:37 AM
  2. [SOLVED] Getting worksheet as range in power query - dynamic
    By jaryszek in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 08-18-2020, 04:48 AM
  3. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  4. [SOLVED] Power Query Advanced SQL - 'Where' from excel range
    By Steveapa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-24-2019, 02:35 PM
  5. Power Query, Excel 2013/ 2016, Dynamic URL, Set parameters
    By dude6571 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 08-17-2019, 12:29 PM
  6. [SOLVED] Creating Dynamic Parameters in Excel from link to Power Query
    By Stefj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2019, 06:58 AM
  7. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1