Results 1 to 11 of 11

Power Query Custom replacer function

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Power Query Custom replacer function

    Hi,
    Can someone help with information or direct me to post or blog re how the replacer function works in M ,

    I have basic replace value ;

    Table.ReplaceValue(  Source, "A", "XX", Replacer.ReplaceValue, {"Item"} )
    which can be re written ;

    Table.ReplaceValue(  Source, "", "", (x, y, z)=> if x = "A" then "XXX" else x , {"Item"} )
    but to take a stage further and replace based on another column;

    Table.ReplaceValue( Source,
    each [Unit] ,
    each if [Item] = "A" then [Unit] * 10 else [Unit] , Replacer.ReplaceValue, {"Unit"} )

    But I cannot figure how to re write with 'custome replacer' , I have tried various such as ;

    =
     Table.ReplaceValue(  Source, 
     each [Unit], "",   (x,y,z)=> if [Item] = "A" then  x * 10 else x ,  {"Unit"} )
    Which I thought item = "A" then z = current valuue * 10 ?

    Richard.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Power Query custom function variable to make table a list
    By Dicken in forum Office 365
    Replies: 10
    Last Post: 07-08-2023, 11:13 AM
  2. How to update a custom function in Power Query
    By MangoFresh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2023, 08:58 AM
  3. Power Query Custom function for running total
    By Dicken in forum Office 365
    Replies: 6
    Last Post: 10-29-2022, 10:58 AM
  4. Power query Custom function / parameter query
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 03-23-2022, 10:41 AM
  5. Replies: 1
    Last Post: 02-14-2022, 06:23 AM
  6. Replies: 1
    Last Post: 11-17-2021, 08:35 AM
  7. Power Query - Invoke Custom Function
    By leukep in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2017, 02:18 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