Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Replace Value in columns whic names appear on a list

Hi All,

 

I want to replace a value in some columns but the number and name of the columns change each time, but I can have them on a list or a differente table

 

For example;

 

I want to use this replace formula

ReplaceformulaReplaceformula

 

 

But intead of writing {"201111", "201112", "201201", "201202", "201203", "201204", "201205", "201206", "201207", "201208"} in the "columnstosearch" par of the function, I wan it to take all the values in the list

 

ListFormulaListFormula

 

 

Thank you all

 

 
1 REPLY 1
Anonymous
Not applicable

try this scheme

 

let
tab=  Table.FromRecords({
        [A = 3, B = 2,C=1], 
        [A = 2, B = 10,C=888],
        [A = 22, B = 2,C=12]
    }),

cols={"A","B"},
newtab=Table.TransformColumns(tab,List.Zip({cols,List.Repeat({each  if _=2 then 999 else _},List.Count(cols))}))

in
newtab

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors