如何显示未过滤的数据

How to show not filtered data

我是power bi的新手,这个问题可能是个常见问题,已经回答了,但我没有找到任何精确的解决方案。

我有两个table; “日期”“帐户”

  1. Dates table 只有一列:"Date"(日期类型)。它只有基于日期的日期值。
  2. Accounts table 有两列; 名称(文本类型)和CreatedDate(日期类型)。

在我的 power bi 模型中,Dates.Date 之间存在关系(多对一,单一,活跃)和 Accounts.CreatedDate 列。


我想显示除过滤后的帐户名。例如,我的 Accounts table 看起来像这样:

Name CreatedDate
A Company 2020-01-01
B Company 2020-12-15
C Company 2021-03-03
D Company 2019-05-27

我有一个切片器并使用 Dates.Date 作为字段。

当我筛选过去 1 年(2020-08-18 - 2021-08-18)的数据时,我想显示未筛选的数据。我想看这个:

Name CreatedDate
A Company 2020-01-01
D Company 2019-05-27

如何显示未过滤的数据?

您可以像下面这样创建过滤器Measure

    _filter:= 
SWITCH (
    TRUE (),
    /* t1 = what is value selected ?*/
    CONVERT ( SELECTEDVALUE ( 'Calendar'[Calendar_Date] ), INTEGER ) = BLANK ()   
    /* t2=what is the max CreatedDate value visble in the filter context*/
    /*if t1 and t2 both blank then return -999 else return t1-t2 which should be 0*/
        && CONVERT ( MAX ( tbl[CreatedDate] ), INTEGER ) = BLANK (), -999, 
    CONVERT ( SELECTEDVALUE ( 'Calendar'[Calendar_Date] ), INTEGER )
        - CONVERT ( MAX ( tbl[CreatedDate] ), INTEGER )
)