Results 1 to 4 of 4

Thread: Max value in list - Power Query
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Apr 2016
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Max value in list - Power Query

    Hi All,

    I have imported data into power query and i want to add custom column which states the latest date in the same table (I will then use this in a subsequent formula). However, I can't for the life of me work out how to do it. I am trying to use "List.Max" but the column just returns errors.

    Not sure how, but I managed to create a query which returns the correct value but I don't know how to reference the value in the subsequent formula. Any help would be greatly appreciated! Thanks,

    Dan

  2. #2
    New Member
    Join Date
    Apr 2015
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Max value in list - Power Query

    You are looking for this solution:

    AddCustom = Table.AddColumn(ChangedType, "Custom", each List.Max(ChangedType[a]))

    Explanation:
    ChangedType - name of previous step in your query
    [a] - name of column to look for max

    You can add this in advanced editor

  3. #3
    New Member
    Join Date
    Apr 2016
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Max value in list - Power Query

    Ralliartur - you are seriously brilliant, thanks so much for your help!

    Where did you learn this 'stuff'? As you can tell I am new to all things 'Power' - did you pick it up through using 'Power' or is the 'coding' similar to something else? I am finding this stuff incredibly useful and would like to train up on it but in a more structured way to what I am doing now which is, have a go, when stuck, go on this forum. Thanks again, first class!

    dan

  4. #4
    New Member
    Join Date
    Apr 2015
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Max value in list - Power Query

    Thanks,

    I've learned from books and blogs (and my own work):

    Books:
    1. Power Query for Power BI and Excel
    2. M Is for (Data) Monkey: A Guide to the M Language in Excel Power Query

    Blogs:
    1. Chris Webb - https://blog.crossjoin.co.uk/category/power-query/
    2. Ken Plus - The Ken Puls (Excelguru) Blog (useful patterns -> https://www.powerquery.training/patterns/)
    and other blogs where Power BI is mentioned


    In most cases you can do all transformations by only using ribbon, but if you want to do more you need to get familiar with M code, and you'll need to learn it from scratch. This is the place where blogs are relevant - you'll find really cool stuff there. Good luck for you.
    Last edited by ralliartur; May 6th, 2016 at 06:04 AM.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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