bi power 两个日期挑较早的日期_在 Power BI 中使用相对日期切片器或筛选器 - Power BI | Microsoft Docs...

news/2024/7/24 7:20:33 标签: bi power 两个日期挑较早的日期

在 Power BI 中创建相对日期切片器和筛选器Creating a relative date slicer and filter in Power BI

09/09/2020

本文内容

适用对象:

面向使用者的 Power BI 服务

面向设计者和开发者的 Power BI 服务

Power BI Desktop

需要 Pro 或 Premium 许可证APPLIES TO:

Power BI service for consumers

Power BI service for designers & developers

Power BI Desktop

Requires Pro or Premium license

借助相对日期切片器 或筛选器 ,可以向数据模型中的任意日期列应用时间筛选器。With the relative date slicer or relative date filter, you can apply time-based filters to any date column in your data model. 例如,可使用相对日期切片器,仅显示过去 30 天(或月、日历月等)的销售数据 。For example, you can use the relative date slicer to show only sales data that's happened within the last 30 days (or month, calendar months, and so on). 刷新数据时,相对时间段会自动应用相应的相对日期约束。When you refresh the data, the relative time period automatically applies the appropriate relative date constraint.

要与 Power BI 同事共享报表,你和这位同事都应具有独立的 Power BI Pro 许可证,并且应将报表保存在 Premium 容量中。To share your report with a Power BI colleague requires that you both have individual Power BI Pro licenses or that the report is saved in Premium capacity.

创建相对日期范围切片器Create the relative date range slicer

相对日期切片器的使用方法与其他任何切片器的使用方法一样。You can use the relative date slicer just like any other slicer. 为报表创建“切片器”视觉对象,再选择日期值作为“字段”值 。Create a slicer visual for your report and then select a date value for the Field value. 在下图中,选择的是“订购日期”字段 。In the following image, we selected the OrderDate field.

选择画布上的切片器,然后选择切片器视觉对象右上角的脱字号。Select the slicer on your canvas and then the carat in the upper-right corner of the slicer visual. 如果视觉对象具有日期数据,则菜单将显示“相对”的选项 。If the visual has date data, the menu displays the option for Relative.

若要使用相对日期切片器,请选择“相对” 。For the relative date slicer, select Relative.

然后,可以选择设置。You can then select the settings.

对于相对日期切片器中的第一个设置,可进行如下选择 :For the first setting in the relative date slicer, you have the following choices:

最后一项Last

下一步Next

本This

通过相对日期切片器中的第二个(中间)设置,可输入一个数字来定义相对日期范围 。The second (middle) setting in the relative date slicer lets you enter a number to define the relative date range.

可以通过第三个设置选择日期度量值。The third setting lets you pick the date measurement. 可以选择下列选项:You have the following choices:

日Days

周Weeks

周(日历)Weeks (Calendar)

月Months

月(日历)Months (Calendar)

年Years

年(日历)Years (Calendar)

如果在此该列表中选择“月”,并在中间设置中输入 2,则结果如下所示 :If you select Months from that list, and enter 2 in the middle setting, here's what happens:

如果今天是 7 月 20 日:If today is July 20:

由切片器约束的视觉对象中包含的数据将显示前两个月的数据,The data included in visuals constrained by the slicer will show data for the previous two months,

即 5 月 21 日到 7 月 20 日(今天的日期)。Starting on May 21 and going through July 20 (today's date).

相比之下,如果选择“月(日历)” ,约束的视觉对象会显示 5 月 1 日到 6 月 30 日(过去两个整日历月)的数据。In comparison, if you selected Months (Calendar), the visuals constrained would show data from May 1 through June 30 (the last two complete calendar months).

创建相对日期范围筛选器Create the relative date range filter

还可以为报表页或整个报表创建相对日期范围筛选器。You can also create a relative date range filter for your report page or your entire report. 为此,请将日期字段拖到“字段”窗格中的“页面级筛选器”或“报表级筛选器”框 :To do so, drag a date field into the Page level filters well or the Report level filters well in the Field pane:

可在此处更改相对日期范围。Once there, you can change the relative date range. 这与自定义相对日期切片器的方式类似 。It's similar to how you can customize the relative date slicer. 在“筛选器类型” 下拉列表中选择“相对日期筛选” 。Select Relative date filtering from the Filter Type drop-down.

选择“相对日期筛选”后,可修改 3 个部分(包括中间的数字框),就像切片器一样 。Once you've selected Relative date filtering, you see three sections to change, including a middle numeric box, just like the slicer.

限制和注意事项Limitations and considerations

目前,使用相对日期范围切片器和筛选器 时,需要遵循以下限制和注意事项。The following limitations and considerations currently apply to the relative date range slicer and filter.

切片器中字段的数据类型必须是日期,而不是默认的文本。The data type for the field in the slicer must be a date, and not the default of text. 否则,切片器中不会显示相对选项。Otherwise, the relative options don't show up in the slicer.

Power BI 中的数据模型不包含时区信息 。Data models in Power BI don't include time zone info. 模型可以存储时间,但并不指明所在时区。The models can store times, but there's no indication of the time zone they're in.

切片器和筛选器始终基于 UTC 的时间。The slicer and filter are always based on the time in UTC. 如果在报表中设置筛选器并将其发送给位于其他时区的同事,你们将看到相同的数据。If you set up a filter in a report and send it to a colleague in a different time zone, you both see the same data. 除非你处于 UTC 时区,否则你和你的同事都必须考虑将会遇到的时间偏移量。Unless you are in the UTC time zone, you and your colleague must account for the time offset you experience.

可使用查询编辑器将在本地时区捕获的数据转换为 UTC 。You can convert data captured in a local time zone to UTC using the Query Editor.

后续步骤Next steps


http://www.niftyadmin.cn/n/1521650.html

相关文章

python 时区转换_Python中如何把一个UTC时间转换为本地时间

[工作积累] OpenGL ES3.0: glInvalidateFramebufferhttps://www.khronos.org/opengles/sdk/docs/man3/html/glInvalidateFramebuffer.xhtml 这个在GLES2.0上只有Exten ...java多线程模拟停车系统import java.util.Random; import jav…

vue中如何实现双向绑定的3中方法(.sync/v-model和普通交互)

目录 参考文章 需求 1、第一步、全局子组件定义child 2、第二步、放官网select例子 3、第三步、普通的父子交互方法 1.1在上面的基础例子上的methods里面添加commit方法: 1.2在父页面中利用方法去获取子页面内容: 1.3实际效果gif 4、第四步、sy…

dad my_经典绘本| My Dad

原标题:经典绘本| My Dad我的爸爸,他很酷!他像大猩猩一样强壮,吃得像河马一样多,不但会唱歌、跳舞,还会游泳、踢足球......我很爱我的爸爸,而且你知道吗?他很爱我&#x…

js 中如何使用(function(global){…})(this)和页面如何调用

目录 参考文章 简单普通funciton 存在问题 GLOBAL写法例子(方法1) 页面调用 GLOBAL写法例子(方法2) 页面调用 GLOBAL写法例子(方法3-用new) 页面调用 参考文章 https://stackoverflow.com/questions/10314891/how-to-use-functionglobal-this简单普通funciton function a(){…

element-ui cascader 重置按钮触发清空操作

前言 有时候我们的提交表单会存在重置操作,那么会重置element-ui中的联级选择器,如果你是自定义组件的联级选择器,你会发现无法清空的情况,实际上你已经在父页面的reset方法中已经重置了下拉组件为空,但是页面上依旧残…

mac cad石材填充图案_CAD识图:建筑行业不可缺专业识图之幕墙

好课推荐:1、CAD2014:点击查看 2、室内&全屋:点击查看 3、CAD2019:点击查看4、CAD2018:点击查看5、Bim教程:点击查看 6、室内手绘:点击查看7、CAD三维:点击查看8、全屋定制&…

vue - html2canvas 将页面表单数据保存为图片下载(可以定义成对象再调用)1.1

目录 前言 图片转化下载 html页面转化成图片 图片直接下载 方法合并 抽象成对象去调用 Brower对象(brower.js) 最终效果 参考文章 总结 前言 我们在手机中经常会看到,长按页面会有一个图片保存的功能,那么将html页面转…

中学生被打处理方式_高考热点作文素材:打工人、内卷化

关注公众号:作文宝藏,每天获取作文好素材!努力吧,中学生!1. “内卷化”是指一种社会或文化模式在某一发展阶段达到一种确定的形式后,便停滞不前或无法转化为另一种高级模式的现象。而这个社会学概念&#x…