Knowledge Base
This section contains articles about best practices, code analysis rules, and DAX optimization patterns for Tabular Editor and Power BI models.
In this section
Best Practice Rules (BPA)
Comprehensive guidelines for building high-quality, maintainable Power BI and Analysis Services models.
- Avoid Invalid Characters in Descriptions - Prevent metadata corruption by removing control characters from descriptions
- Avoid Invalid Characters in Object Names - Ensure object names contain only valid characters
- Data Column Must Have Source - Verify all data columns have proper source mappings
- Relationship Columns Must Have Same Data Type - Enforce data type consistency in relationships
- Visible Objects Should Have Descriptions - Ensure all visible objects have meaningful descriptions
- Trim Leading and Trailing Spaces from Object Names - Remove leading and trailing spaces from names
- Expression Required for Calculated Objects - Validate that calculated objects have expressions
- Provide Format String for Numeric and Date Columns - Apply consistent formatting to numeric and date columns
- Provide Format String for Measures - Provide format strings for all measures
- Set SummarizeBy to None for Numeric Columns - Prevent inappropriate summarization of numeric columns
- Date Table Should Exist - Ensure proper date table configuration
- Hide Foreign Key Columns - Hide foreign key columns from end users
- Many-to-Many Relationships Should Use Single Direction - Enforce single-direction filtering in many-to-many relationships
- Avoid Provider Partitions with Structured Data Sources - Use proper partition sources for structured data
- Translate Descriptions for All Cultures - Support multi-language descriptions
- Translate Display Folders for All Cultures - Localize display folder names
- Translate Hierarchy Level Names for All Cultures - Translate hierarchy level captions
- Translate Perspective Names for All Cultures - Localize perspective names
- Translate Visible Object Names for All Cultures - Translate visible object names for all cultures
- Perspectives Should Contain Objects - Ensure perspectives contain relevant objects
- Calculation Groups Should Contain Items - Validate calculation group definitions
- Set IsAvailableInMDX to False - Control MDX availability of objects
- Set IsAvailableInMDX to True When Necessary - Enable MDX availability when required
- Remove Auto Date Tables - Clean up auto-generated date tables
- Remove Unused Data Sources - Eliminate unused data source definitions
- Specify Application Name in Connection Strings - Set application names in connection strings for monitoring
- Use Latest Compatibility Level for Power BI Models - Maintain compatibility with latest Power BI features
- Use Compound Names for User-Defined Functions - Ensure UDF names don't conflict with future built-in DAX functions
Code Actions
DAX Code Analysis (DI)
Improvement suggestions for DAX code structure and efficiency. These rules identify opportunities to simplify and optimize your expressions.
- Remove unused variable - Remove unused variable
- Remove unused variable - Remove unused variable
- Remove table name - Remove table name
- Add table name - Add table name
- Rewrite table filter as scalar predicate - Rewrite table filter as scalar predicate
- Split multi-column filter into multiple filters - Split multi-column filter into multiple filters
- Simplify SWITCH statement - Simplify SWITCH statement
- Remove superfluous CALCULATE - Remove superfluous CALCULATE
- Avoid calculate shortcut syntax - Avoid calculate shortcut syntax
- Use MIN/MAX instead of IF - Use MIN/MAX instead of IF
- Use ISEMPTY instead of COUNTROWS - Use ISEMPTY instead of COUNTROWS
- Use DIVIDE instead of division - Use DIVIDE instead of division
- Use division instead of DIVIDE - Use division instead of DIVIDE
- Replace IFERROR with DIVIDE - Replace IFERROR with DIVIDE
- Replace IF with DIVIDE - Replace IF with DIVIDE
DAX Refactoring (DR)
Refactoring suggestions for complex or inefficient DAX patterns. These rules help modernize and improve readability of your DAX code.
- Convert to scalar predicate - Convert to scalar predicate
- Use aggregator instead of iterator - Use aggregator instead of iterator
- Use VALUES instead of SUMMARIZE - Use VALUES instead of SUMMARIZE
- Prefix variable - Prefix variable
- Prefix temporary column - Prefix temporary column
- Move constant aggregation to variable - Move constant aggregation to variable
- Simplify 1-variable block - Simplify 1-variable block
- Simplify multi-variable block - Simplify multi-variable block
- Rewrite using DISTINCTCOUNT - Rewrite using DISTINCTCOUNT
- Rewrite using COALESCE - Rewrite using COALESCE
- Rewrite using ISBLANK - Rewrite using ISBLANK
- Remove unnecessary BLANK - Remove unnecessary BLANK
- Simplify negated logic - Simplify negated logic
- Simplify using IN - Simplify using IN
DAX Rewrites (RW)
Suggested rewrites for specific DAX patterns that can be expressed more effectively using alternative syntax.
- Rewrite TOTALxTD using CALCULATE - Rewrite TOTALxTD using CALCULATE
- Rewrite using FILTER - Rewrite using FILTER
- Invert IF - Invert IF