FormulaCamp
Completed
10. Power Pivot and DAX · Time and Model Quality · 15 min

7. A Good Model: Star Schema, Measures, and Speed

Lesson 7 of 8
    Lesson theory

    The Power Pivot model compresses data column by column. Speed and size depend on how the model is built more than on the formulas.

    • The star: one fact table (narrow and long) with lookup tables around it. Don't glue everything into one wide table;
    • remove unneeded columns already in Power Query: every column with unique values (an invoice number, a time down to the second) bloats the file;
    • prefer measures to calculated columns: a column is stored in the model for every row, a measure is computed only for the report;
    • a simple condition in CALCULATE (Products[Category] = "Beverages") is faster than FILTER(Sales, …) over the whole fact table;
    • relate tables on integers or short codes, and set the filter direction from the lookup table to the facts;
    • a separate date table with every day in a row, marked as the date table, is a requirement for time intelligence functions.

    Test yourself

    1. Which model is better for Power Pivot?
    2. You need profit for any slice of the report. What do you choose?
    3. Which column will increase the size of the model the most?
    4. What is faster in CALCULATE?
    5. Why might TOTALYTD calculate incorrectly?