Add calculated tables and columns to Power BI Desktop models Flashcards

1
Q

What is a calculated table in Power BI?

A

A table created using a DAX formula that generates new tables within the model.

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

When should you use calculated tables?

A

When you need intermediate tables to simplify complex calculations or to create static tables for the model.

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

How do you create a calculated table in Power BI?

A

By using the New Table feature and writing a DAX formula to define the table’s content.

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

Give an example of a DAX formula for creating a calculated table.

A

Sales Summary = SUMMARIZE(Sales, Sales[Product], “Total Sales”, SUM(Sales[Sales Amount]))

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

What is the first step to create a calculated column in Power BI?

A

Ensure the table in Data view is selected, then use the “New column” option in the Table tools ribbon.

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

How do you create a fiscal year calculated column in DAX?

A

Due Fiscal Year = “FY” & YEAR(‘Due Date’[Due Date]) + IF(MONTH(‘Due Date’[Due Date]) > 6, 1)

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

How can you define a calculated column for fiscal quarters?

A

Due Fiscal Quarter = ‘Due Date’[Due Fiscal Year] & “ Q” & IF(MONTH(‘Due Date’[Due Date]) <= 3, 3, IF(MONTH(‘Due Date’[Due Date]) <= 6, 4, IF(MONTH(‘Due Date’[Due Date]) <= 9, 1, 2)))

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

What DAX formula converts a date to “yyyy mmm” format?

A

Due Month = FORMAT(‘Due Date’[Due Date], “yyyy mmm”)

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

How do you create a MonthKey column in Power BI?

A

MonthKey = (YEAR(‘Due Date’[Due Date]) * 100) + MONTH(‘Due Date’[Due Date])

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

What is row context in DAX?

A

Row context refers to the current row being evaluated in a table, allowing calculations to be performed on a row-by-row basis.

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

How is row context automatically applied in DAX?

A

It is automatically applied in calculated columns and row-level calculations in tables.

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

Can row context be applied to measures?

A

No, row context cannot be directly applied to measures, which work with filter context.

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

How can row context be created in a measure?

A

By using functions like SUMX, FILTER, and RELATED, which iterate over rows.

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

What are the three techniques to add columns to a model table in Power BI?

A
  1. Add columns to a view or table in a relational database.
  2. Add custom columns using M in Power Query.
  3. Add calculated columns using DAX in model tables.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is it recommended to add custom columns in Power Query?

A

They load to the model in a more compact and optimal way.

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

When should you use a calculated column in Power BI?

A

When the formula depends on summarized model data or requires specialized DAX functions like RELATED or RELATEDTABLE.