MSDN Community Articles

Designing Measures in Analysis Services

Effective measure design is crucial for unlocking the full potential of your Analysis Services data model. Measures are the calculations that users will perform to analyze business data. This article provides a comprehensive guide to designing robust, performant, and user-friendly measures.

Understanding Measures

In Analysis Services, measures are typically defined using Multidimensional Expressions (MDX) or Data Analysis Expressions (DAX), depending on the compatibility level and type of your Analysis Services project (Tabular vs. Multidimensional). They represent aggregations, calculations, and business logic applied to your data.

Key Principles for Measure Design

Common Measure Patterns

Here are some common patterns and examples for designing measures:

1. Basic Aggregations

These are the simplest measures, often directly mapping to column aggregations.

Example (DAX):

Total Sales = SUM(Sales[SalesAmount])

Example (MDX):

[Measures].[Internet Sales Amount] = SUM(InternetSales[SalesAmount])

2. Time Intelligence Measures

Time intelligence calculations are fundamental for analyzing trends over time.

Example (DAX): Year-to-Date Sales

YTD Sales = TOTALYTD([Total Sales], 'Date'[Date])

Example (MDX): Year-to-Date Sales

([Measures].[Internet Sales Amount], YTD([Date].[Calendar].CurrentMember))

Tip:

Always ensure you have a robust Date dimension with a continuous date hierarchy for effective time intelligence calculations.

3. Ratio Measures

Ratios help compare different measures or aspects of your data.

Example (DAX): Sales to Cost Ratio

Sales to Cost Ratio = DIVIDE([Total Sales], [Total Cost])

4. Ranking Measures

Ranking measures can identify top performers or trends.

Example (DAX): Product Rank by Sales

Product Rank = RANKX(ALL('Product'[ProductName]), [Total Sales], , DESC, Dense)

Best Practices for Naming and Organization

Performance Considerations

Conclusion

Designing effective measures requires a blend of technical understanding and business acumen. By following these principles and best practices, you can create measures that are not only accurate and performant but also empower your users to gain deeper insights from your data.

For more advanced scenarios, explore functions like CALCULATE in DAX and context modification in MDX.