本文介绍了打开 RLS 时 DAX 测量不起作用 - 连接路径应形成一棵树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Power BI 中,当 RLS 开启时,我的度量值出现以下错误(RLS 关闭时不会显示此错误):

In Power BI, I have the following error for a measure when RLS is turned on (this error does not show when RLS is off):

Join paths are expected to form a tree but the table has two join paths

这些是模型中的相关关系:

These are the relevant relationships in the model:

我有一段不活跃的关系.此非活动关系用于有问题的度量.但由于它是不活动的,我会认为这不会是一个问题?措施是:

I have an inactive relationship. This inactive relationship is used in the measure with the problem. But as it is inactive, I would have thought it wouldnt be an issue?? The measure is:

TTipsInvs =
VAR SalesValue =
    CALCULATE (
        SUM ( ANSAPBICustomerTransDetailed[Outstanding] ),
        USERELATIONSHIP ( 'ANSAPBICustomerTransDetailed'[SiteID], ANSAPBISites[Site ID] )
    )
RETURN
    IF ( ISBLANK ( SalesValue ), 0, ( SalesValue ) )

开启 RLS 后有什么方法可以避免这个问题?

Any way to avoid this issue when RLS is turned on?

为所有帮助干杯

推荐答案

TTipsInvs =
VAR SiteID =
    CALCULATETABLE (
        VALUES ( ANSAPBISites[Site ID] ) )
VAR SalesValue =
    CALCULATE (
        SUM ( ANSAPBICustomerTransDetailed[Outstanding] ),
        TREATAS ( SiteID, 'ANSAPBICustomerTransDetailed'[SiteID] ) )
RETURN
    IF ( ISBLANK ( SalesValue ), 0, ( SalesValue ) )

这篇关于打开 RLS 时 DAX 测量不起作用 - 连接路径应形成一棵树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 09:28