Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Analyzing Data with Power BI and Power Pivot for Excel (Alberto Ferrari, Marco Russo) (z-lib.org).pdf
Скачиваний:
11
Добавлен:
14.08.2022
Размер:
18.87 Mб
Скачать

FIGURE 4-44 In ISO Year 2008, the Sales SPLY measure reports the sales of the same period in 2007.

You can author similar calculations, like the previous month and the percentage of growth against the same period in the last year, using a very similar technique. In scenarios like the latter one, adding a simple column to the model makes it extremely easy to compute values. Performing the same calculation without the ISO Day Number column results in a nearly impossible-to-write formula. You can find more information and different dissertations on this topic at http://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/.

Conclusions

Time intelligence is a very broad and interesting topic. It is likely that any BI solution you will ever author will contain some portion devoted to time

intelligence. The most important topics covered in this chapter are as follows:

Most (if not all) time-intelligence calculations require the presence of a Date table in the model.

The creation of a Calendar table requires attention to details like the sort order of the months.

If you have multiple dates in the model, this does not mean you need to have multiple Date tables. Using a single Date table in the model makes all the calculations much easier. If you need multiple dates, you will likely need to load the Date table multiple times.

It is mandatory to separate date and time, both for performance and modeling reasons.

The remaining part of the chapter was devoted to different scenarios related to time, such as working days in one or multiple countries, computing values for special periods of the year by using new columns in the Date table or new tables in the model, and finally handling calculations with ISO calendars.

Due to the vast amount of diversity that exists in time-intelligence calculations, it is likely that none of the examples we have shown fit perfectly with your specific scenario. Nevertheless, you can use these scenarios as inspiration for your own calculations, which will typically require the creation of some specific columns in the Date table and the authoring of DAX code of medium complexity.