我的数据集中有两个日期信息,并尝试完全填充表格的上对角线。
我可以通过这个方法计算对角线值,
Count Distinct Customer First Month of Year =
VAR selected_year= SELECTEDVALUE(table1[Year])
VAR selected_month=SELECTEDVALUE(table1[MonthNumber])
RETURN
CALCULATE(
DISTINCTCOUNT(table1[CustomerID]),
FILTER(table1, table1[Deposit_Year]=selected_year && table1[Deposit_Month]=selected_month)
)
但是,我需要将这些对角线值分配给一年中所有接下来的几个月,如下所示,
(行=表1(存款_年份)和表1(存款_月份))
(列=表1(年)和表1(月))
谢谢你,
维利
尝试以下操作(但不确定)- 将
table1[Deposit_Month] <= selected_month
从 =
更改为 <=
:
Count Distinct Customer First Month of Year =
VAR selected_year = SELECTEDVALUE(table1[Year])
VAR selected_month = SELECTEDVALUE(table1[MonthNumber])
RETURN
CALCULATE(
DISTINCTCOUNT(table1[CustomerID]),
FILTER(
table1,
table1[Deposit_Year] = selected_year &&
table1[Deposit_Month] <= selected_month
)
)