By using DAX, you can add 3 types of calculations to your data model:
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
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
The DIVIDE function
TheDIVIDEfunction automatically handles division by zero cases. If an alternate result isn’t passed in, and the denominator is zero or BLANK, the function returns BLANK.
You’re developing a data model in Power BI Desktop. You’ve just added a date table by using the CALENDARAUTO function. You’ve extended it with calculated columns, and you’ve related it to other model tables. What else should you do to ensure that DAX time intelligence calculations work correctly?
A. Add time intelligence measures to the date table
B. Mark as a Date table
C. Add a fiscal hierarchy
D. Add a date column
Mark as a Date table so that Power BI can correctly filter its dates.
Difference between calculated column and a measure
Row context
The formula for a calculated column is evaluated for each table row.
or[RELATEDTABLE]DAX function. TheRELATEDfunction retrieves the value at the one-side of the relationship, while theRELATEDTABLEretrieves values on the many-side. TheRELATEDTABLE`function returns a table object.LOOKUPVALUEUsing DAX Time Intelligence Functions …
simplifies the task of modifying date filter context
Date Table Requirement:
DATESYTD
Returns a single-column table that contains dates for the year-to-date (YTD) in the current filter context.
DATESBETWEEN
Returns a table that contains a column of dates that begins with a given start date and continues until a given end date.
DATESINPERIOD
Returns a table that contains a column of dates that begins with a given start date and continues for the specified number of intervals.