Starting to explore time series data

Trend Analysis in Power BI

Jacob H. Marquez

Data Scientist at Microsoft

What is a "time series"?

$$

Definition:

  • A series of data points graphed in chronological order.

  • Most commonly, it is a sequence taken at successive equally spaced points in time.

1 https://en.wikipedia.org/wiki/Time_series
Trend Analysis in Power BI

Use cases for time series analysis

$$

Use Cases:

  • Patterns (e.g. cyclical) in a variable
  • Season-specific trends
  • Systemic challenges
  • Relationships with a target outcome
  • Informing a forecasting model

$$

Examples:

  • Weather
  • Heart rate monitoring
  • Quarterly sales
  • Interest rates
Trend Analysis in Power BI

Analyzing at different date grains

An image showing the date 2019-03-25 08:30 being decomposed into it's year, month, and day parts.

Trend Analysis in Power BI

Analyzing at different date grains

An image showing the date 2019-03-25 08:30:00 being decomposed into it's hour, minute, and seconds parts.

Trend Analysis in Power BI

Mutating into different time variables

An image showing the date 2019-03-25 08:30:00 being mutated into day of year, week of year, and day of week parts.

Trend Analysis in Power BI

Mutating into different time variables

The subscription_start_date variable being compared to the current date to derived the subscription age and age_group.

Trend Analysis in Power BI

Measuring the change over a period of time

Period-over-period change

The calculation for period-over-period change.

Trend Analysis in Power BI

Measuring the change over a period of time

Period-over-period change

The calculation for period-over-period change.

Month Stock Price MoM Change
Jan 2018 $20.67 --
Feb 2018 $19.79 -4.3%
Mar 2018 $21.34 7.9%
Apr 2018 $21.25 -0.4%
May 2018 $22.12 4.1%
Jun 2018 $22.85 3.3%
Trend Analysis in Power BI

DAX functions for dates

DATE(): constructs a date value from parts (e.g. year, month, and day)

LEFT(): extracts a given number of characters from a set of characters, starting from the left side.

RIGHT(): extracts a given number of characters from a set of characters, starting from the right side.

MID(): extracts a given number of characters from a set of characters, starting from a defined place in the set.

WEEKDAY(): returns the day of the week as a number; default is to use the number 1 for Sunday.

Trend Analysis in Power BI

Let's practice!

Trend Analysis in Power BI

Preparing Video For Download...