在我的计算表中,变量
AsOfDate
应该被切片机反射
dim_Date
这也是计算表。
计算表
CrossTableEffectiveDate
从表派生
fact_Premium
那有
Date
关系到
迪米特日期
.
我错了:
Circular Dependency Calculated Column
CrossTableEffectiveDate =
VAR AsOfDate = VALUE("2019-01-31") //This value should be based on date value in a slicer
VAR CrossTables =
CROSSJOIN(
SUMMARIZE(fact_Premium,
fact_Premium[PolicyNumber],
fact_Premium[CompanyLocationGuid],
fact_Premium[Coverage],
fact_Premium[State],
fact_Premium[SICCode],
fact_Premium[ASLOB],
fact_Premium[ProducerGUID],
"Start", MIN(fact_Premium[EffectiveDate]),
"End", MAX(fact_Premium[ExpirationDate]),
"Premium", SUM(fact_Premium[Premium])
),
'Calendar')
VAR RiskPeriods =
ADDCOLUMNS(
FILTER(CrossTables,
'Calendar'[EoMonth] >= [Start] && 'Calendar'[Month] <= [End] && 'Calendar'[Month] <= AsOfDate),
"StartRiskMonth", IF([Start] > 'Calendar'[Month], [Start], 'Calendar'[Month]),
"EndRiskMonth", IF([End] < 'Calendar'[EoMonth], [End], 'Calendar'[EoMonth])
)
RETURN SELECTCOLUMNS(RiskPeriods,
"PolicyNumber", fact_Premium[PolicyNumber],
"CompanyLocationGUID", fact_Premium[CompanyLocationGuid],
"Coverage",fact_Premium[Coverage],
"State", fact_Premium[State],
"SICCode",fact_Premium[SICCode],
"ASLOB", fact_Premium[ASLOB],
"ProducerGUID",fact_Premium[ProducerGUID],
"StartRiskMonth", [StartRiskMonth],
"EndRiskMonth", [EndRiskMonth],
"YearNum", YEAR('Calendar'[Month]),
"Qtr", ROUNDUP(MONTH('Calendar'[Month])/3, 0),
"MonthNum", MONTH('Calendar'[Month]),
"WrittenPremium", [Premium],
"DaysInMonth", [EndRiskMonth] - [StartRiskMonth] + 1,
//"EndRiskMonth-Start", [EndRiskMonth] - [StartRiskMonth] + 1,
//"End-Start",[End] - [Start] + 1,
"EarnedPremium", [Premium] *
DIVIDE([EndRiskMonth] - [StartRiskMonth] + 1, [End] - [Start] + 1))
我该怎么做
过时的
变量由引用
日期
切片机
迪米特日期
?