Powerbi 功率BI:单中频条件下的多个条件

Powerbi 功率BI:单中频条件下的多个条件,powerbi,Powerbi,我有一个带有字段金额、条件1、条件2的表 例如: Amount Condition1 Condition2 ---------------------------------- 123 Yes Yes 234 No Yes 900 Yes No 我想根据条件计算20%的金额: 如果Condition1和Condition2均为是,则计算20%else0 My try:我尝试使用条件自定义列,但无法在查询编辑器

我有一个带有字段
金额、条件1、条件2
的表

例如:

Amount  Condition1   Condition2
----------------------------------
123     Yes          Yes
234     No           Yes
900     Yes          No
我想根据条件计算20%的金额:

如果
Condition1
Condition2
均为是,则计算
20%
else
0


My try:我尝试使用条件自定义列,但无法在查询编辑器中添加
IF

尝试创建新的计算列。 并使用以下DAX查询:

new_column = IF(Conditition1 = "Yes", IF(Condititon2 = "Yes",Amt * 0.2 ,0), 0)

您可以这样编写条件列:

= IF(AND(Table1[Condition1] = "Yes", Table1[Condition2] = "Yes"), 0.2 * Table1[Amount], 0)
或者,您可以使用
&&
代替
功能:

= IF(Table1[Condition1] = "Yes" && Table1[Condition2] = "Yes", 0.2 * Table1[Amount], 0)
或者使用连接的更短版本:

= IF(Table1[Condition1] & Table1[Condition2] = "YesYes", 0.2 * Table1[Amount], 0)