powerbi - 如何使用筛选器从另一个表的三列在 Power BI 中创建新表?
问题描述
我在索引列中有一个重复值的表,第三列仅在某些行中有值
我现在有的表:
我的目标是创建一个新表,该表选择 CompanyID、开始日期和联系日期列,但从其中排除具有空白值的行
我想要的新表:
我使用了以下 DAX 代码:
CALCULATETABLE (
Table,
FILTER ( Table, NOT ( ISBLANK ( Table[Start Date] ) ) )
)
这段代码的问题是它选择了我原始数据的所有 350 多列,而不是只选择我想要的 3 列。此外,我无法弄清楚如何添加其他过滤器,因此我没有联系日期和 ComapanyID 的空白行
我也尝试了下面的代码,但它不起作用
CALCULATETABLE (
Table,
FILTER ( Table, NOT ( ISBLANK ( Table[Start Date] ) ) ),
FILTER ( Table, NOT ( ISBLANK ( Table[Order Date] ) ) ),
FILTER ( Table, NOT ( ISBLANK ( Table[Employee Count] ) ) )
)
解决方案
SELECTCOLUMNS 函数允许您选择特定的列。
例如:
New Filtered Table =
EVALUATE
SELECTCOLUMNS (
CALCULATETABLE (
Table,
NOT ( ISBLANK ( Table[Start Date] ) ),
NOT ( ISBLANK ( Table[Order Date] ) ),
NOT ( ISBLANK ( Table[Employee Count] ) )
),
"CompanyID", Table[CompanyID],
"Contact Date", Table[Contact Date],
"Start Date", Table[Start Date]
)
推荐阅读
- google-cloud-firestore - 在 MobX 中正确同步 Firestore 集合
- hyperledger-fabric - 新加入的组织中的 Hyperledger Fabric 链码实例化失败
- database - LINQPad 使用哪些信息来生成关联属性/导航属性?
- python - Sqlite 到 csv 到 excel 转换不在列中插入值
- java - 在 Xpages 中。如何将 serviceBean(由 extlib REST 服务调用)中的值传递回注释文档
- c++ - 什么时候不调用被覆盖的虚函数
- c++ - 将值从数组修改为另一个时输出不正确
- corda - Corda 4 - 通过特定的 transactionid 查询 vault
- javascript - 如何使用 Kendo 禁用和启用复选框
- android - React Native libhermes.so Android