我在多个订单中得到了一个包含“组件”和所需数量“ToIssQty”的表格,已按组件和所需日期排序,需要在组件上每次机会添加一个包含运行总计的列
我使用了以下公式,但是它只返回每个组件的总数,仍然需要显示每行的增量
RunTotalToIss =
CALCULATE (
SUM (TBL_WorkOrder_Detail[ToIssQty]),
FILTER(
TBL_WorkOrder_Detail,
TBL_WorkOrder_Detail[Component]
= EARLIER(TBL_WorkOrder_Detail[Component])
)
)
也许尝试这样的事情:
SUMX (
FILTER (
TBL_WorkOrder_Detail,
TBL_WorkOrder_Detail[Component] = EARLIER ( TBL_WorkOrder_Detail[Component] )
&& TBL_WorkOrder_Detail[Date] <= EARLIER ( TBL_WorkOrder_Detail[Date] )
),
TBL_WorkOrder_Detail[ToIssQty]
)
你可以尝试用下面这个测量-
RunTotalToIss =
var this_row_component = min(TBL_WorkOrder_Detail[Component])
var this_row_releasedDate = min(TBL_WorkOrder_Detail[releasedDate])
return
CALCULATE (
SUM (TBL_WorkOrder_Detail[ToIssQty]),
FILTER(
ALL(TBL_WorkOrder_Detail),
TBL_WorkOrder_Detail[Component] = this_row_component
&& TBL_WorkOrder_Detail[releasedDate] < this_row_releasedDate
)
)