如何在canvas powerapps中通过列乘法获取所有行的总和?

问题描述 投票:0回答:1

我在 SQL Server 中有一个名为 InvoiceLines 的表,其中包含以下记录。

InvoiceID    ProductDescription    Quantity    UnitRate
1            Tow Fee               2.00        217.39
1            Tow Fee               1.00        110.00

在我的 Canvas Power 应用程序(显示一个标签)中,我想要将 QuantityUnitRate 相乘,然后将 InvoiceID1 的所有记录求和。因此,在文本属性中,我添加了这段代码。

LookUp(InvoiceLines, ThisItem.InvoiceID = InvoiceID,Sum(Quantity*UnitRate))

其中 ThisItem.InvoiceID1。但它给出的结果为434.78。它只考虑第一个记录,而不考虑第二个记录。我想要的结果是544.78。我怎样才能在画布应用程序中做到这一点?

powerapps-canvas power-platform
1个回答
0
投票

Lookup 仅返回第一个找到的结果。 改为用户过滤器。 Sum(Filter(Table, ColumnName = DesiredValue), 数量 * 单位费率)

© www.soinside.com 2019 - 2024. All rights reserved.