Dax 计算和表格创建

问题描述 投票:0回答:1

o我有这个公式

L_RM = FILTER(L_BRT,(L_BRT[Due Date]>= DATE(YEAR(TODAY())-1,1,1)) && 
(L_BRT[Type] IN {"HR Training", "Issue-Remediation", "PDMS", "Policy Deviation","SoD User Account Access", "SoD Service Account Management", "SoD Entitlement Verification","Action Plan"})
&& (L_BRT[Mandatory/Required Training] IN {"Mandatory", BLANK()}))

我正在尝试更新 HR 类型,以仅包含官方 IT 截止日期为 Y 的项目,并从今年 2024 年开始添加一些其他类型:

Network Pentest Finding          
LCM Model - EOL 
LCM Model - Missing Attribute(s)
Security Baseline-Attestation
Security Baseline-Baseline Amendment
Security Baseline-Baseline Deviation
Security Baseline-Existing Baseline
MCT Exceptions
Compliance

并应包括从今年 2024 年开始所需的培训

我有这个公式,但我没有得到正确的值

L_RM = FILTER(L_BRT,(
    (L_BRT[Due Date] >= DATE(YEAR(TODAY()) - 1, 1, 1)
     && ( (L_BRT[Type] = "HR Training" && L_BRT[OfficialITDueDateRM] = "Y")
    || ( L_BRT[Type] IN { "Issue Remediation", "PDMS", "Policy Deviation", "SoD User Account Access", "SoD Service Account Management", "SoD Entitlement Verification", "Action Plan" }
    && L_BRT[Mandatory/Required Training] = "Mandatory"))
    || (( L_BRT[Mandatory/Required Training] = "Required" && L_BRT[Due Date] >= DATE(2024, 1, 1) )
    || ( L_BRT[Due Date] >= DATE(2024, 1, 1) && L_BRT[Type] IN {"Compliance", "Network Pentest Finding", "MCT Exceptions", "LCM Model - EOL", "LCM Model - Missing Attribute(s)", "Security Baseline-Attestation", "Security Baseline-Baseline Amendment", "Security Baseline- Baseline Deviation", "Security Baseline Existing Baseline" }
     )))))

作为替代方案,我使用 Dax 创建了 2 个表,并使用 union 和distinct 创建了最终表

在联合表中时,我对某些项目得到一些错误的值,但在附加联合之前的每个单个表中,它是正确的,请帮忙,请参阅下面的公式

L_RM1 = FILTER(L_BRT,(L_BRT[Due Date]>= DATE(YEAR(TODAY())-1,1,1)) && ( (L_BRT[Type] = "HR Training" && L_BRT[OfficialITDueDateRM] = "Y")
    ||(L_BRT[Type] IN {"Issue-Remediation", "PDMS", "Policy Deviation","SoD User Account Access", "SoD Service Account Management", "SoD Entitlement Verification","Action Plan"}) && (L_BRT[Mandatory/Required Training] IN {"Mandatory", BLANK()})))

L_RM2 = FILTER(L_BRT,(L_BRT[Due Date]>=  DATE(2024, 1, 1) && (L_BRT[Type] IN {"Network Pentest Finding", "MCT Exceptions", "LCM Model - EOL", "LCM Model - Missing Attribute(s)", "Security Baseline-Attestation", "Security Baseline-Baseline Amendment", "Security Baseline- Baseline Deviation", "Security Baseline Existing Baseline", "Compliance"}) && (L_BRT[Mandatory/Required Training] IN {"Required", BLANK()})))
L_RM = DISTINCT (UNION (L_RM1, L_RM2))
powerbi dax
1个回答
0
投票

对于您的单一更新过滤器公式,仅包含“HR 培训”的“官方 IT 截止日期”为“Y”的项目,并从 2024 年起添加具有“必需”培训的新类型:

L_RM = FILTER(
    L_BRT,
    (L_BRT[Due Date] >= DATE(YEAR(TODAY()) - 1, 1, 1) &&
        ((L_BRT[Type] = "HR Training" && L_BRT[OfficialITDueDateRM] = "Y") ||
        (L_BRT[Type] IN {"Issue-Remediation", "PDMS", "Policy Deviation", "SoD User Account Access", "SoD Service Account Management", "SoD Entitlement Verification", "Action Plan"} &&
         L_BRT[Mandatory/Required Training] = "Mandatory"))) ||
    ((L_BRT[Due Date] >= DATE(2024, 1, 1) &&
        L_BRT[Type] IN {"Network Pentest Finding", "LCM Model - EOL", "LCM Model - Missing Attribute(s)", "Security Baseline-Attestation", "Security Baseline-Baseline Amendment", "Security Baseline-Baseline Deviation", "Security Baseline-Existing Baseline", "MCT Exceptions", "Compliance"} &&
        L_BRT[Mandatory/Required Training] IN {"Required", BLANK()}))
)
© www.soinside.com 2019 - 2024. All rights reserved.