在需要单个值的地方提供了 table 个多个值

A table of multiple values was supplied where a single value was expected

我正在尝试创建 KPI,为此我尝试创建一个变量

我有这个公式

Total_Sales_Variable = 
IF ( 
    VALUES (BillingDocument_Header[Billing Doc. currency_WAK] ) = "USD",
    139.2,
    1
) * 
CALCULATE ( 
    SUM (BillingDocument_Item[Sales Amount_NEWR]),
    FILTER ( 
        'Invoice_Calender',
        'Invoice_Calender'[Fiscal_Year] = 2016 &&
       'Invoice_Calender'[Fiscal_Year]  = 2017
    ),
    FILTER ( 
        'BillingDocument_Header',
        'BillingDocument_Header'[Bill Type_FKRT] <> "Z2" &&
        'BillingDocument_Header'[Bill Type_FKRT] <> "Z2"
    )
)

当我添加这个时显示错误

MdxScript(Model) (8, 5) 度量 'Invoice_Calender'[Total_Sales_Variable] 中的计算错误:在需要单个值的地方提供了多个值的 table。

我正在尝试实现 Billing Doc。 currency_WAk 是美元然后我想根据过滤器 Fiscal_Year = {'2016','2017'} 和 [Billing Type_FKART] ={'ZG2','ZL2'}

这就是我想在 power bi 中实现的我想将其转换为 dax 表达式 power bi qlik意义表达

    if([Billing Doc. currency_WAERK] = 'USD',
sum({< Fiscal_Year = {'2016','2017'},[Billing Type_FKART] -={'ZG2','ZL2'}>}[Billing Sales Amount_NETWR])*139.2,
sum({< Fiscal_Year = {'2016','2017'},[Billing Type_FKART] -={'ZG2','ZL2'}>}[Billing Sales Amount_NETWR]))

有什么帮助吗?

更新附件

请检查带有数据的 pbix 文件和 tables

https://www.dropbox.com/s/flondhallo08j98/test4.pbix?dl=0

已编辑:现在我们终于清楚了您的 table 结构和关系,并了解了您需要的措施!

Total Sales Variable = 
CALCULATE ( 
    SUMX ( 
        VALUES ( test_billing_doc_header[Billing Doc. currency_WAERK] ),
        IF ( 
            test_billing_doc_header[Billing Doc. currency_WAERK] = "USD",
            139.2,
            1
        ) * SUM ( test_biilingg_doc_item[Billing Sales Amount_NETWR] )
    ),
    Invoice_Calender[Fiscal_Year] = 2016 || Invoice_Calender[Fiscal_Year] = 2017, 
    test_billing_doc_header[Billing Type_FKART] <> "ZG2" && test_billing_doc_header[Billing Type_FKART] <> "ZL2"
)

PBIX 文件:https://pwrbi.com/so_55914086-3/