cgal slicer

    科技2022-08-01  118

    cgal slicer

    One of the things I like most about Power BI are — Bookmarks. For those who are not familiar, Bookmarks are one of the favorite and most used features in Power BI.

    我最喜欢Power BI的一件事-书签。 对于不熟悉的人, 书签是Power BI中最受欢迎和最常用的功能之一 。

    Basically, what Bookmark does, it captures the current state of the report, so you can use it for a reference in your actions through buttons, images, shapes, etc. Simply said, this will give you the possibility to create an app-like experience for your report and make it look interactive.

    基本上,书签的作用是捕获报告的当前状态,因此您可以通过按钮,图像,形状等将其用作操作中的参考。简单地说,这将使您可以创建类似于应用程序的应用程序您的报告具有丰富的经验,并使其看起来具有交互性。

    当空间成为问题时... (When space becomes a problem…)

    There are really dozen use cases where you can apply bookmarking, but I will focus here on a specific problem: I would say it’s a frequent issue and I assure you that sooner rather than later you will face this problem during the report designing process.

    确实有十个用例可以在其中应用书签,但是在这里我将重点讨论一个特定的问题:我会说这是一个常见问题,并且向您保证,在设计报告的过程中,您会尽快而不是稍后遇到此问题。

    So, we created our nice little Power BI report, everything looks fine, we have our 3–4 slicers on the page, so far, so good. But, one day our users want to have an additional slicer for, let’s say, brand category. No problem, I will make existing slicers smaller and secure a space for the new one. Then, after a month or two, our users want to have one more slicer, than after another month or two, one more, etc. I think you get the point…

    因此,我们创建了一个不错的Power BI小报告,一切看起来都很好,页面上有3–4个切片器,到目前为止,一切都很好。 但是,有一天,我们的用户希望为品牌类别增加一个切片器。 没问题,我将使现有的切片机更小,并为新切片机保留空间。 然后,在一两个月后,我们的用户想要再增加一个切片器,而不是再过一两个月,再等等,我想您明白了……

    So, what should we do when we can’t accommodate all requested slicers on our report page? The first option is to tell our users to choose which ones are the most important for them and then to discard others…Just kidding, of course, you shouldn’t do that:).

    因此,当我们无法在报告页面上容纳所有请求的切片器时,我们该怎么办? 第一种选择是告诉我们的用户选择对他们来说最重要的用户,然后丢弃其他用户……开个玩笑,当然,您不应该这样做:)。

    We can create a separate report page that will contain slicers only? Or…we can create a slicer pane, which will hold all of our slicers on the existing report page…And we will be able to show or hide this slicer pane, depending on the user’s choice.

    我们可以创建一个单独的报告页面,其中仅包含切片器吗? 或者...我们可以创建一个切片器窗格,该切片器窗格将所有切片器保存在现有的报告页面上...并且我们将能够显示或隐藏此切片器窗格,具体取决于用户的选择。

    As a bonus, we will give our users an option to reset all the slicers with one click!

    作为奖励,我们将为我们的用户提供一键重置所有切片机的选项!

    从头开始建设 (Building from the scratch)

    Here is how my report canvas looks like in the beginning:

    这是我的报告画布在开始时的样子:

    The first thing I’m going to do is to turn on Bookmarks Pane and Selection Pane under the View tab, so I can take full control of manipulating different objects within the report.

    我要做的第一件事是打开“视图”选项卡下的“书签窗格”和“选择窗格”,这样我就可以完全控制在报表中操作不同的对象。

    As you see, we haven’t created any bookmarks so far, but shortly and we will do.

    如您所见,到目前为止,我们还没有创建任何书签,但是不久之后我们会创建。

    The only “strange” item on the report canvas you can notice is the filter icon in the upper left corner. That icon will be used to open a slicer pane we are going to build.

    您可以注意到,报告画布上唯一的“奇怪”项目是左上角的过滤器图标。 该图标将用于打开我们将要构建的切片器窗格。

    The next step is to create all necessary slicers for the report. I’ve created 8 different slicers, based on users’ request. In case you need to display all selected slicers in your report, please refer to this article.

    下一步是为报告创建所有必要的切片器。 根据用户的请求,我创建了8个不同的切片器。 如果您需要在报告中显示所有选定的切片器,请参阅本文 。

    Finally, I’ll add a nice rectangle shape, which will serve as a pane for all of my slicers, and an icon for closing the slicer pane.

    最后,我将添加一个漂亮的矩形形状,该形状将用作所有切片器的窗格,并提供一个用于关闭切片器窗格的图标。

    Now we have all our elements on the report page, so the next step is to define the visibility of specific items within the bookmarks, and to define actions for navigating through the bookmarks.

    现在,我们在报表页面上拥有了所有元素,因此下一步是定义书签中特定项目的可见性,并定义在书签中导航的操作。

    As we have all our elements on the canvas, let’s first create a bookmark which will capture the current state of the page:

    在画布上拥有所有元素之后,我们首先创建一个书签,该书签将捕获页面的当前状态:

    I clicked on Add and named my bookmark Slicer Pane Expanded. The most important thing is to uncheck the Data option (click on three dots to open this menu) so that we can be sure that slicers aren’t reset when users switch between the bookmarks.

    我单击添加,并将书签“切片器窗格扩展”命名为书签。 最重要的是取消选中“数据”选项 (单击三个点以打开此菜单),这样我们可以确保当用户在书签之间切换时不会重置切片器。

    Now, let’s set the Action property of our filter icon, so we can specify what do we want it to do:

    现在,让我们设置过滤器图标的Action属性,以便我们可以指定要执行的操作:

    By doing this, we instructed our icon to navigate us to the report state captured by the Slicer Pane Expanded bookmark.

    通过这样做,我们指示我们的图标将我们导航到Slicer Pane Expanded书签捕获的报告状态。

    Now, let’s set the state when the slicer pane is collapsed. First, I’ll hide all items related to the slicer pane in Selection:

    现在,让我们设置切片器窗格折叠时的状态。 首先,在“选择”中隐藏与切片器窗格相关的所有项目:

    I can now create a new bookmark, called Slicer Pane Collapsed, using the same rules as in the previous step:

    现在,可以使用与上一步相同的规则创建一个新的书签,称为“切片器窗格折叠”。

    One important remark from my side regarding the Selection pane: by dragging elements up and down, you are defining the order of visibility on the report page! That means if the rectangle shape which serves as a slicer pane is above our slicers in the Selection pane, and the rectangle is not transparent, it will cover our slicers and they will not be visible. So, make sure that you define the right order of elements here.

    我这边关于“选择”窗格的一个重要评论是: 通过上下拖动元素,您可以定义报告页面上的可见性顺序! 这意味着如果用作切片器窗格的矩形形状在“选择”窗格中的切片器上方,并且该矩形不是透明的,则它将覆盖我们的切片器,并且它们将不可见。 因此,请确保在此处定义元素的正确顺序。

    Once I do CTRL + click on our filter icon, look what happens:

    一旦执行CTRL +单击我们的过滤器图标,看看会发生什么:

    Our slicer pane is there! And I can select whatever values I want in my slicers, they will be propagated to visuals “behind”. One last thing to configure here is to define an action for an icon for closing the slicer pane:

    我们的切片器窗格在那里! 而且,我可以在切片器中选择所需的任何值,这些值将传播到“背后”的视觉效果。 这里要配置的最后一件事是为关闭切片器窗格的图标定义一个操作:

    And now, let’s check how it works in reality:

    现在,让我们检查一下它是如何工作的:

    Awesome, isn’t it?

    太好了,不是吗?

    奖励提示-一键重置所有过滤器! (Bonus tip — Reset all filters with one click!)

    Now, the final touch to make our users even happier…It would be quite cumbersome when someone chooses 8 different values in 8 different slicers to go back to the default selection. One would have to click one by one slicer and clear the selection.

    现在,使我们的用户更加开心的最后一步……当有人在8个不同的切片器中选择8个不同的值返回默认选择时,这将非常麻烦。 一个人必须一一点击切片器并清除选择。

    So, let’s help our users with this! First, I will put a blank button within our newly created Slicer pane. I’ve formatted the button to look nicer and to “tell” our users what is it about — I think that “Reset All” is self-explanatory here.

    因此,让我们以此帮助我们的用户! 首先,我将在我们新创建的“切片器”窗格中放置一个空白按钮。 我对按钮进行了格式化,以使其看起来更好,并“告诉”用户有关的内容-我认为“全部重置”在这里不言自明。

    Now, let’s create another bookmark, which we’ll call Slicer Pane Reset. Apply the same steps as previously, but don’t uncheck the Data option! This will capture the current state of the page (including all the selections within slicers), so once we navigate to this state via a bookmark, it will also “transfer” the captured data state (in our case, it’s the state where all slicers are reset to default):

    现在,让我们创建另一个书签,我们将其称为“切片器窗格重置”。 应用与之前相同的步骤,但不要取消选中“数据”选项! 这将捕获页面的当前状态(包括切片器中的所有选择),因此一旦我们通过书签导航到该状态,它还将“传输”捕获的数据状态(在我们的情况下,这是所有切片器的状态)重置为默认值):

    Once again, let’s check if everything works as expected:

    再一次,让我们检查一下一切是否按预期进行:

    Absolutely perfect!

    绝对完美!

    结论 (Conclusion)

    As you witnessed, we pushed the filtering experience to a whole new level, using bookmarks in our report. Your users will love you — you supplied all slicers they wanted, but you also saved space on your report to accommodate more visuals or to give existing ones a little more space.

    如您所见,我们在报告中使用了书签,将过滤体验提升到了一个全新的水平。 您的用户会爱上您-您提供了他们想要的所有切片器,但是您还节省了报表上的空间以容纳更多的视觉效果或为现有的视图提供更多的空间。

    翻译自: https://towardsdatascience.com/build-pro-slicer-pane-in-power-bi-911248b39348

    cgal slicer

    Processed: 0.016, SQL: 8