简体   繁体   English

在 Power BI Measure 中按其他两个表中的值筛选表

[英]Filter Table by Values from two other tables in Power BI Measure

In my current report in PowerBI I need data from a table "Booking Data" with bookings of users that were not planned.在我当前的 PowerBI 报告中,我需要“预订数据”表中的数据,其中包含未计划的用户预订。 These are to be matched with data from table "Project Members" and entered in a row from table "Projects" as a total Count at the right ID.这些将与“项目成员”表中的数据相匹配,并在“项目”表的一行中作为正确 ID 的总计数输入。

Currently I get the number of users who have booked to the respective ID.目前,我得到了预订到相应 ID 的用户数量。 Now I need to match these names with the "Project Members" fields and if there are not in the "Project Members" table then they need to count.现在我需要将这些名称与“项目成员”字段匹配,如果“项目成员”表中没有,那么他们需要计数。

I got the Tables "Project Members", "Projects" and "Booking Data".我得到了“项目成员”、“项目”和“预订数据”表。

在此处输入图像描述

My current outcome:我目前的结果:

not Planned User = 
CALCULATE(
    DISTINCTCOUNT('Booking Data'[User]),
    FILTER(
        'Booking Data', 
        Projects[ID] = 'Booking Data'[ID]
    ) 
)

I am now missing the " matching " with the Project Members table, but so far everything has run on error for me.我现在缺少与 Project Members 表的“匹配”,但到目前为止,一切对我来说都是错误的。

This is how I would get that "anti-join" counting.这就是我如何获得“反加入”计数。 Filter 'BookingData' down to the records that have no match between BookingData[User] and ProjectMember[Project Member].将“BookingData”过滤到 BookingData[User] 和 ProjectMember[Project Member] 之间不匹配的记录。 Then distinct count the user.然后对用户进行不同的计数。

When you set this measure alongside a Project column in a visual, you will get the grouping effect that you're after.当您在视觉对象中的项目列旁边设置此度量时,您将获得您所追求的分组效果。

NotPannedUser =
CALCULATE (
    DISTINCTCOUNT ( BookingData[User] ),
    FILTER (
        BookingData,
        NOT BookingData[User] IN VALUES ( ProjectMember[Project Member] )
    )
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Power BI-DAX度量。 来自另一个表的切片器值 - Power BI - DAX measure. Slicer values from another table 通过测量功率BI过滤 - Power BI Filter by Measure 如何创建过滤器,以过滤Power BI可视表上的度量“生成”的值? 可能吗? - How can I create a filter that filter values “generated” by a measure on a visual table on Power BI? Is it possible? Power BI - 从 Measure 创建表 - Power BI - Create table from Measure Power Bi中如何根据过滤器切换两个表中的数据 - How to switch data from two tables based on filter in Power Bi 通过比较来自不同 Power 查询表的两列,然后可能应用筛选器 (Power BI),在表视觉对象中添加一列 - Add a column in a table visual by comparing two columns from different power query tables and then possibly apply a filter (Power BI) POWER BI - DAX - 测量过滤器 - POWER BI - DAX - Measure filter 是否可以在Power BI中创建引用两个不共享关系的表的度量? - Can a measure be created in Power BI that references two tables that share no relationship? 如何在 Dax 中使用过滤器 function 时阻止 Power Bi 测量隐藏其他字段 - How to stop Power Bi measure from hiding other fields when using the filter function within Dax Power BI Measure to countrows of related values几个相关表的深度 - Power BI Measure to countrows of related values several related tables deep
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM