+ Reply to Thread
Results 1 to 2 of 2

Creating function to repeat Power Query steps

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-09-2013
    Location
    City, World
    MS-Off Ver
    Office 365
    Posts
    248

    Creating function to repeat Power Query steps

    Hi
    Is it possible to create a function that would repeat Power Query steps? For example if I used Power Query to split a column then I want to repeat these steps on different table; hence I need to create a function that would repeat these steps. Is that possible? I did not do my search but I thought I would start here first. Thank you very much.

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

    Cool Re: Creating function to repeat Power Query steps

    adapt this to your needs

    let
      Source = Excel.CurrentWorkbook(){[Name = "Table1"]}[Content],
      Result = List.Accumulate(
        Table.ColumnNames(Source), 
        Source, 
        (st, cur) => 
          if List.AnyTrue(List.Transform(Table.Column(st, cur), each Text.Contains(_, "|")))
          then Table.SplitColumn(st, cur, Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), 2)
          else st
      )
    in
      Result
    you can change pipe "|" to any other delimiter

+ 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: 12-23-2022, 09:50 AM
  2. help with understand Power Query steps/code
    By lastnn30 in forum Excel General
    Replies: 16
    Last Post: 12-12-2022, 06:29 PM
  3. Copy applied steps in Excel Power Query
    By admat in forum Excel General
    Replies: 4
    Last Post: 02-14-2022, 12:46 PM
  4. [SOLVED] Creating button for Power Query -->Refresh All
    By lastnn30 in forum Excel General
    Replies: 2
    Last Post: 11-29-2021, 03:55 PM
  5. Replies: 11
    Last Post: 10-02-2019, 10:53 AM
  6. 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
  7. [SOLVED] Changing Power Query rows to columns on repeat cells.
    By beaglesBuddy in forum Excel General
    Replies: 3
    Last Post: 06-14-2017, 02:13 PM

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