powerbi - 在 Power BI 中将计算列更改为度量
问题描述
我想将计算列更改为度量,以便我可以使用切片器更改 Power BI 中的度量。
我想将 table1 的值和 table1 的免赔额与 table2 的阈值(下一行)进行比较,并总结 table1 的值。
样本数据:
Table1
Value Deductible
51000 45000
56000 57000
Table2
Threshold The Result to calculate
50000 51000
55000 107000
60000
输出是表 2 中的第二列。
计算列的代码是:
value_below_threshold =
VAR CurThreshold = table2[Threshold]
VAR NextThreshold = table2[Threshold] + 5000
VAR __RelevantRowsTable2 =
FILTER (
'table1',
'table1'[value] < NextThreshold
&& 'table1'[Deductible] < NextThreshold
)
VAR __RelevantRowsTable3 =
FILTER (table2,
contains(
'table2',
table2[Threshold],
NextThreshold)
)
RETURN
CALCULATE ( sum(table1[value]), __RelevantRowsTable2, __RelevantRowsTable3 )
但我不知道如何将此计算列更改为度量值。有人可以帮我解决这个问题吗?非常感谢!
解决方案
推荐阅读
- express - 为什么将文件从一台服务器发送到另一台服务器时收到错误请求 (400)?
- java - Spring响应式WebClient使用StepVerifier重试测试
- c# - 标签上的 XAML Datatrigger 不会更新内容
- reactjs - React JS(Ice js)错误:解构不可迭代实例的无效尝试
- reactjs - 使用 redux thunk TypeError 在 Next js 中出错:nextCallback 不是函数
- mysql - mysql“听起来像”和“order by”
- ios - 将地址转换为苹果地图链接以与他人分享
- python - 使用 python 像 google 一样搜索 HTML
- python - 如何在点击时更改背景颜色?
- ios - SwiftUI 更新地图区域导致有关修改状态的警告