我有一个4表:
- Dim_Calendar(日期、年、月)
- 发电机房(名称)
- 服务器每月费用(日期、服务器id、机房名称、费用)
- 发电机房每月费用(日期、发电机房名称、费用)
模型如下:
- Dim_Calendar[Date] 1:n每月发电机房费用[Date]
- Dim_Calendar[Date] 1:n服务器每月费用[Date]
- 发电机房[名称]1:n个月发电机房费用[发电机房名称]
- 发电机房[名称]1:n服务器每月费用[发电机房名称]
然后在表monthly costs of the server
上创建一个计算列:
Generator Room Cost = [room cost]
,测量值为
[room cost] = SUM('monthly costs of the Generator Rooms'[cost])
则表monthly costs of the server
中每行的计算列被房间名称和日期过滤,正如我从书中读到的,行上下文与表列一致,表monthly costs of the server
中的列不能过滤表monthly costs of the Generator Rooms
中的数据。
我不知道为什么
阅读书中关于章节行上下文过渡的内容
计算列是静态的。你可以过滤它们,但它们不会在过滤器更改时重新计算。