我创建了一个度量,用于计算每个项目的完成百分比。但是我的客户希望它在项目完成后(即前100%之后)显示空白。
我已经尝试使用If函数,但是它每个月都返回相同的值。我也在网上查看,但没有找到解决方案。这是我的%OfCompletion度量及其依赖的度量。
% of Completion:=
VAR sproject =
IF ( HASONEVALUE ( Project[Project] ), VALUES ( Project[Project] ) )
RETURN
CALCULATE (
DIVIDE (
[S Expenses Running Total],
CALCULATE (
[Total Sales Costs] + [Total Sales Hours],
ALL ( Sales ),
Sales[Project] = sproject
)
),
Project[Classification] = "IN"
)
Expenses Running Total:= CALCULATE (
[Total Sales Costs] + [Total Sales Hours],
FILTER (
ALL ( Dates ),
Dates[Current Month Offset] <= MAX ( Dates[Current Month Offset] )
)
)
答案 0 :(得分:1)
这将检查当前月份的完成情况是否为100%,前一个月份的完成情况是否也为100%,并返回空白-否则返回实际的完成值:
Monthly Completion Measure:=
IF (
[% of Completion] = 1 &&
CALCULATE (
[% of Completion],
PARALLELPERIOD (
Dates[Date],
-1,
MONTH
)
) = 1,
BLANK,
[% of Completion]
)