Power Query 条件列 - 将 2 个值合并为 1 Line/Output

Power Query Conditional Columns - Combine 2 values for 1 Line/Output

是否可以将 1 个 line/output 的 2 个值合并为一个条件列?下面是一个例子。

当前,2 行:

each if 
[source] = "Source" and [medium] = "Medium" and [medium-2] = "Paid Search" 
or [source] = "Source" and [medium] = "Medium" and [medium-2] = "cpc"
then ="Paid Search"

需要,1 行 - 将“medium-2”的两个值合并为 1 行:

each if
[source] = "Source" and [medium] = "Medium" and [medium-2] = "Paid Search" or "cpc"
then ="Paid Search"

感谢您的帮助, 斯科特

逻辑上,

([source] = "Source" and [medium] = "Medium" and [medium-2] = "Paid Search") or
([source] = "Source" and [medium] = "Medium" and [medium-2] = "cpc")

相当于

[source] = "Source" and [medium] = "Medium" and
( [medium-2] = "Paid Search" or [medium-2] = "cpc" )

( A && B && C ) || ( A && B && D ) = ( A && B ) && ( C || D )

如果问题与语法更相关,那么我会指出

[medium-2] = "Paid Search" or [medium-2] = "cpc"

可以改写为

List.Contains( { "Paid Search", "cpc" }, [medium-2] )

除非您有两个以上的选择,否则不会短很多。