Analyzing calculation groups


While calculation groups are not evaluated by the current version of DAX Optimizer, you can create a measure that implements the same code of an existing calculation item.

Creating a measure for each calculation item

Consider the following calculation item:

PY =
CALCULATE ( 
    SELECTEDMEASURE (), 
    SAMEPERIODLASTYEAR ( 'Date'[Date] ) 
)

You can create a measure with the same code and replace the SELECTEDMEASURE() function with a measure reference that invokes one of the measures of the model – possibly, a significative one used with the calculation item.

Test PY =
CALCULATE ( 
    [Sales Amount], 
    SAMEPERIODLASTYEAR ( 'Date'[Date] )
)

You could also create multiple measures for the same calculation item, one for each measure you want to test with the same type of calculation. By comparing the memory and CPU cost of the new measure for the calculation item with the corresponding costs of the original measure, you can get an idea about the additional cost introduced by the calculation item. Unfortunately, the relevance score might not be so helpful because the new measure is undoubtedly not referenced by any other measure.

Calculation items in existing measures

Unfortunately, if a measure in the model applies a calculation item to other measures, the calculation item cost is ignored. For example, consider the following measure:

Sales YTD =
CALCULATE ( 
    [Sales Amount],
    'Calc group'[Calc item] = "YTD"
)

The cost applied by the YTD calculation item is ignored, so you will see that Sales YTD has the exact cost as Sales Amount. This is a limitation of the current version of DAX Optimizer, which should be improved in future versions.

Last update: Dec 16, 2024