DAX - Common Date Table Flashcards

1
Q

What is the risk of not using a common date table?

A

The different fact tables might represent dates differently.

Making it difficult to compare different dates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is another name for a common date table?

A

A Date Dimension table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the common date table necessary for?

A

Using time intelligence functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What specs must the common date table meet?

A
  1. One record per day
  2. NO missing or blank dates
  3. Minimum and Maximum dates must cover what you will use in your calculations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are two functions you can use to create a common date table?

A
  1. CALENDAR
  2. CALENDARAUTO
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CALENDAR syntax

A

CALENDAR(StartDate, EndDate)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

CALENDAR example

A

Date=CALENDAR
(
DATE(2017, 1, 1),
DATE(2021, 12, 31)
)

Just writing a long sentence so the formula will left justify

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What do you need to do after you’ve created a common date table?

A

Mark as Date table in Power BI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does “mark as date table” do?

A

Overrides the Power BI’s auto generated date dimension for all time intelligence and date based calculations in DAX within the data model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where do you go to create a Common Date Table in M?

A

In the Transform Data area:
Home tab->New Source->Blank Query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Create Common Date Table M syntax

A

=List.Dates(#date(2017, 01, 01), 365*5, #duration(1, 0, 0, 0))

This creates a 5 year date table starting at 1/1/2017

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the #duration syntax?

A

duration(days, hours, minutes, seconds)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the List.Dates syntax?

A

List.Dates(Start as Date, Count as Number, Step as Duration)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you change the dates list created by going to New Source->Blank Query and using the List.Dates formula to a table?

A

Tranform Tab->To Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What must you do after creating a common date table using PowerQuery M?

A

Change the date column you created to have a date format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you add additional columns to the date table? For example, year, month, etc.

A

Transform Data->Add Column->Date->Select you desired period

17
Q

What is the final step after you have created the Date table in PowerQuery M?

A
  1. Close and Apply then Mark as Date Table
  2. Establish relationships between new Date table and other necessary tables
18
Q

What does WEEKDAY function give you?

A

The day of the week as a number 1-7