Modeling the Data Flashcards
By using DAX, you can add 3 types of calculations to your data model:
- Calculated tables
- Calculated columns
- Measures
How can DAX be used to enforce filters over model tables
By using RLS
The formula can duplicate or transform existing model data or create a series of data to produce a new table and always imported into your model?
Calculated tables
Cons of Calculated Tables
Increases model storage size and can prolong data refresh time
Calculated tables are useful in
- Date tables
- Role playing dimensions
- What-if analysis
What table is required to apply special time filters known as time inteligence
Date tables
When your source data doesnt include a date table, you can create one as calculated tables by using the
CALENDAR or CALENDARAUTO function
In this example, the MinDate and MaxDate in the data model are July 1, 2010 and June 30, 2011.
CALENDARAUTO() will return
all dates between January 1, 2010 and December 31, 2011.
In this example, the MinDate and MaxDate in the data model are July 1, 2010 and June 30, 2011.
CALENDARAUTO(3) will return
CALENDARAUTO(3) will return all dates between April 1, 2010 and March 31, 2012.
*Hint: July(7)-3 = Apr(4)
June(6) -3 = March(3)
What-if parameters allow report users to
select or filter by values that are stored in the calculated table. For example, awhat-ifparameter could allow the report user to select a hypothetical currency exchange rate, and a measure could divide revenue values (in a local currency) by the selected rate.
Formula is evaluated for each table row and it returns a single value
Calculated Columns
Concerned with achieving summarisation over model data and returns a single value.
Measures
_____ are evaluated at query time and their results are never stored in the model
Measures
Compound Measure
When a measure references one or more measures, it’s known as compound measure
Implicit vs Explicit Measures
- Explicit: model calculations that are written in DAX
- Implicit measures: columns that can be summarised by visuls in simplistic ways like counts, sum, minimum, maximum, etc. Implicit measures are noted by $\sum$