Creating time factors in PowerBI

為{幸葍}努か 提交于 2019-12-12 03:21:37

问题


I have data on a hourly basis.

I would like to format and view the mean of these values across different time factors. Such as daily, weekly, monthly, nightly (9 pm to 6 am) and so on.

I've looked at splices and the DAX formatting of new columns and been playing around with that - but so far been unsuccesful.

Data example

Date                Value
28-06-2016 01:00    1
28-06-2016 02:00    1
28-06-2016 03:00    6
28-06-2016 04:00    9
28-06-2016 05:00    15
28-06-2016 06:00    17
28-06-2016 07:00    18
28-06-2016 08:00    21
28-06-2016 09:00    25
28-06-2016 10:00    30
28-06-2016 11:00    38
28-06-2016 12:00    41
28-06-2016 13:00    43
28-06-2016 14:00    45
28-06-2016 15:00    50
28-06-2016 16:00    57
28-06-2016 17:00    58
28-06-2016 18:00    60
28-06-2016 19:00    70
28-06-2016 20:00    77
28-06-2016 21:00    85
28-06-2016 22:00    85
28-06-2016 23:00    91
29-06-2016 00:00    91
29-06-2016 01:00    97
29-06-2016 02:00    99
29-06-2016 03:00    99
29-06-2016 04:00    100
29-06-2016 05:00    104
29-06-2016 06:00    113
29-06-2016 07:00    122
29-06-2016 08:00    125
29-06-2016 09:00    126
29-06-2016 10:00    134
29-06-2016 11:00    143
29-06-2016 12:00    150
29-06-2016 13:00    158
29-06-2016 14:00    162
29-06-2016 15:00    171
29-06-2016 16:00    174
29-06-2016 17:00    179
29-06-2016 18:00    181
29-06-2016 19:00    185
29-06-2016 20:00    195
29-06-2016 21:00    197
29-06-2016 22:00    203
29-06-2016 23:00    205

回答1:


I would tackle this back in the Edit Queries window of Power BI Desktop. This component was formerly known as Power Query back when it was just an Excel Add-In.

In Edit Queries / PQ, there is a richer set of Date functions that should meet your requirements:

https://msdn.microsoft.com/en-us/library/mt296606.aspx

I also find the build and test tasks much easier there. You can even copy your Queries to & from Excel PQ for a great test/review experience.



来源:https://stackoverflow.com/questions/38077457/creating-time-factors-in-powerbi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!