根据其他两个列在电源查询中放置字符串
当在两列中满足条件时,我正在尝试用字符串替换值。
第1列 | 第2列 | 第3列3 |
---|---|---|
A | 1 | 步骤1- a |
B | 2 | 步骤2的描述 - b |
步骤1的描述b c | C 1 | 1步骤1- c c |
c c | 3 | 步骤3的描述 |
A | 1 | 步骤1- a |
B | 3 | 步骤3的描述 - B 3步骤3-对于B的第一步, |
我尝试了该代码
= Table.ReplaceValue(
#"Renamed Columns",
each [Column 3],
each if [Column 1] = "A" and [Column 2] = "1" then "Step 1 - Description for step one for A" else [NULL])
,我计划在第1列和第2列的所有组合中迭代此代码第3列中的字符串。
我将如何完成此操作?提前致谢!
I'm trying to replace a value with an string when a condition is met in two columns.
Column 1 | Column 2 | Column 3 |
---|---|---|
A | 1 | Step 1 - Description for step one for A |
B | 2 | Step 2 - Description for step one for B |
C | 1 | Step 1 - Description for step one for C |
C | 3 | Step 3 - Description for step one for C |
A | 1 | Step 1 - Description for step one for A |
B | 3 | Step 3 - Description for step one for B |
I tried the code
= Table.ReplaceValue(
#"Renamed Columns",
each [Column 3],
each if [Column 1] = "A" and [Column 2] = "1" then "Step 1 - Description for step one for A" else [NULL])
where I was planning to iterate this code for all the combinations of column 1 and 2 (where each combination gets a certain string in column 3).
How would I be able to get this done? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我肯定会创建并合并桌子,但是如果您想这样做
,您必须做否则null 否则[null] 列名。 否则null 也不起作用,因为PowerQuery是案例敏感的
,还要检查您是否打算使用第1列或 column1 差异是区别在于n和1
I would definitely create and merge a table, but if you want to do it this way
note, you have to do else null not else [NULL] unless you really have that column name. else NULL would not work either since powerquery is case sensitive
Also check if you mean to use Column 1 or Column1 the difference being a space between the n and 1