Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Preload measures into model

Hello, I'm building a report with a huge amound of data, and then I'm presenting this data in a matrix with a lot of calculated measures which are also SWITCH()es between 3 other measures. Endresult ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    By definition, measures cannot be precalculated as they depend on the filter context. So the answer to your question is no.

     

    What you can do is precalculate tables and columns: if you have a "fixed" context when your value is calculated, you can precalculate the measure and store it in a column.


    For example, i have a Forecast measure that needs to be calculated on a range 1-10 as these are the days of the forecast. I have a filter on page where you can choose the number of days, and the measure will take into account. However, as this measure is calculated in a matrix and so with several different filter context (one for each row) I precalculate all 10 values of this measure in a table and use a column "days" to choose which day it to show.

     

    It's not always doable but can help rethinking your model on "what" can be calculated in advance. The more, the better.

     

    Also, investigate of bottlenecks of your model. Sometimes a small change in a DAX formula can lead to massive improvements.