Dax 1677526120
Dax 1677526120
DAX
General Guidelines & Best Practices
DATA MODEL
Cardinality (unique values) is of the utmost importance - aim to minimize as much as possible
- Split columns (i.e. DateTime should always be a column for Date and one for Time).
This should be done at the source, not after being imported!
- Reduce exactness of data if business requirements allow
- Convert to integers if possible
Calculated Columns:
- Try to compute at the source if possible. Can use DAX to create calculated
columns but could get better compression if they are done at the source
- Do not store partial calculations as they take up memory
- Complex filters are good candidates for calculated columns
First and foremost: reduce For- Start at the “Server Timings” Always clear the cache before
mula Engine (FE) and increase tab in DAX Studio and the running tests. Can keep the cache
Storage Engine (SE) usage “Duration” column warm to run further test if need
be, but always start with a cold
Try to reduce the amount of Try to mitigate CallBackDataID Look at the # Records being
materialization of data as because queries with given to the FE from the SE in
much as possible CallBackDataID: the PQP. The number of records
here should be as close to the
- Physical Query plan has a amount of records required for
- Are slower than pure SE the output. If the Records
“Records” column. This num-
queries number is very high this can be
ber should be as close to the
- Remove the data caching a sign of early materialization.
number of the output query
feature of the SE Aim for late materialization!
as possible.
- However, if the “Duration” is
small no need to worry
- Date functions (e.g., LAST
Date), Math functions (e.g.,
ROUND), Error Functions
Be careful with context transition in an iterator. Remember: a measure has an implied calculate
wrapped around which invokes context transition.
Variables help with readability/debugging/performance. Remember: variables are computed once where they
are defined, not where they are used. Also, that are immutable (cannot be changed)
Use CALCULATE/CALCULATETABLE over FILTER when possible (look for a “WHERE” clause in the SE Query
Use SUMMARIZE to group and ADDCOLUMNS to add calculated columns to that table
www.enterprisedna.co | [email protected]