Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
Looking to replace all values 'X1' in column A with values 'X2' using M language. Can't duplicate column A.
Condition is that only replace the values for date range between 01/01/20 to 06/06/20 using column 'Date' in same table.
Solved! Go to Solution.
Hi, @Qotsa
try the code below:
= Table.ReplaceValue(
YouPreviousStepName,
each [Date]>=#date(2020, 01, 01) and [Date]<=#date(2020, 06, 06),
each [column A]="X1",
(x,y,z)=>if y and z then "X2" else x,
{"column A"}
)
Hi, @Qotsa
try the code below:
= Table.ReplaceValue(
YouPreviousStepName,
each [Date]>=#date(2020, 01, 01) and [Date]<=#date(2020, 06, 06),
each [column A]="X1",
(x,y,z)=>if y and z then "X2" else x,
{"column A"}
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.