在Power BI中的Slicer中未选择值时显示过滤的数据

发布于 2025-02-09 21:05:58 字数 518 浏览 2 评论 0原文

我有两个桌子,一次是用于切片机,另一个是用于详细信息表。详细信息表上有一个发票列,其中一些行具有空白的发票。切片机的表格如下:

”在此处输入图像描述”

切片机仅显示ID 1的值,如下所示。

最初我希望将切片机访问,并且数据应仅显示发票为空白的行。用户将切片机选择为包括发票记录,它应该显示两个详细信息,即带有空白 +非空的日期行的行。

I have two tables, once for slicer and other one is for details table. The details table have a InvoiceDate column where some rows have blank InvoiceDate. The slicer table looks like below:

enter image description here

The slicer will only show value of of ID 1, like below.

enter image description here

Initially I want slicer to be un checked and the data should show only rows where InvoiceDate is Blank. Once User select the Slicer as Include Invoiced Records, it should show both full details i.e. Rows with Blank + Non-Empty dates rows.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

佞臣 2025-02-16 21:05:58

还有另外两种做您想要的方法可能更“正确”的方法,但我还将描述一种提供您描述的行为的方法。

选项一:删除第二个表。如下:

Invoice Status = IF (ISBLANK([Invoice Date]) = TRUE(), "Not yet invoiced", "Invoiced")

使用[发票状态]创建一个切片机,并简单地默认显示“未发票”。如果用户想查看发票记录,他们也只需在切片机中选中该框即可。

选项两个:使用书签和按钮产生所需的效果。创建两个按钮,其中一个说“包括发票客户”,另一个说“隐藏开具的客户” - 创建两个书签,其中一个将发票客户从视觉上过滤掉了,一个发票客户未过滤。将每个按钮的“动作”设置为适当的书签。

选项三保留“切片机”表。假设它称为“发票过滤器选择”。创建一个新措施:

IncludeDetailFilter = 

IF (ISFILTERED('Invoice Filter Selection'[Value]) = True(),
    1,
    IF (ISBLANK(MAX(InvoiceDetails[Invoice Date])) = TRUE(), 1, 0)
)

切片机有选择时,将被视为“过滤”,您将进入该措施始终评估为1的第一分支。当未选择切片机时,该措施将评估到1或0,具体取决于该行中发票日期是否有任何值。将此新措施添加为发票详细信息视觉上的过滤器。

未选中:

检查:

There are two other ways of doing what you want that are probably more 'correct' but I'll also describe a way to provide the behavior you describe.

Option one: Delete your second table. Add a calculated column to your details table as follows:

Invoice Status = IF (ISBLANK([Invoice Date]) = TRUE(), "Not yet invoiced", "Invoiced")

Create a slicer using [Invoice Status] and simply default it to show 'not invoiced.' If users want to see the invoiced records, they just check that box in the slicer as well.
enter image description here

Option Two: Use Bookmarks and buttons to produce the desired effect. Create two buttons, one that says 'Include Invoiced Customers' and another that says 'Hide Invoiced Customers' -- create two bookmarks where one has the invoiced customers filtered out of the visual and one where the invoiced customers aren't filtered. Set each button's "Action" to the appropriate bookmark.

Option Three Keep your 'slicer' table. Let's assume it's called 'Invoice Filter Selection.' Create a new measure:

IncludeDetailFilter = 

IF (ISFILTERED('Invoice Filter Selection'[Value]) = True(),
    1,
    IF (ISBLANK(MAX(InvoiceDetails[Invoice Date])) = TRUE(), 1, 0)
)

When the slicer has a selection, it will be considered 'Filtered' and you will pass into the first branch of the IF where the measure always evaluates to 1. When the slicer isn't selected, the measure will evaluate to 1 or 0 depending on whether or not there are any values for Invoice Date in the row. Add this new measure as a filter on your invoice detail visual.

Unchecked:

enter image description here

Checked:

enter image description here

Hope it Helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文