Forum Discussion

PremierPBI's avatar
PremierPBI
Regular Visitor
2 years ago
Solved

Search & return values within the same table

Hi All  I have a very simple table listing rebate IDs & rebate term percentages Some rebate IDs are stand alone, but some IDs have 'Parent Group IDs'   I want to add a new column that looks at 'P...
  • dufoq3's avatar
    dufoq3
    2 years ago

    In your query RABATE_GROUPS

    1. select last step
    2. create new step via circled button
    3. place there code below
    4. replace #"Changed Type" with your previous step reference.

     

     

    = Table.AddColumn(#"Changed Type", "Custom", each if [PARENT_REBATE_GROUP_ID] = 0 then [REBATE_TERMS_PERCENTAGE] else #"Changed Type"{[ID = [PARENT_REBATE_GROUP_ID]]}[REBATE_TERMS_PERCENTAGE], type number)