mr_power_bi's avatar
mr_power_bi
Regular Visitor
11 months ago
Status:
New

DAX Code Folding

Idea: Add code folding functionality to DAX editor with collapsible code blocks and indentation levels

Feature Description:

I would like to propose adding code folding functionality to the DAX code editor in Power BI Desktop. Currently, while we have line numbering and code formatting with proper indentation, we lack the ability to collapse/expand code sections.

Proposed Enhancement: Add collapsible code blocks similar to other modern code editors (Visual Studio, VS Code, etc.) that would allow users to:

  • Fold indented code blocks - Collapse nested calculations, SWITCH statements, complex IF conditions, TABs indent
  • Fold custom sections - Allow manual folding of selected code ranges
  • Visual indicators - Small arrow/plus icons next to foldable lines
  • Preserve folding state - Remember collapsed sections when reopening measures/calculated columns
  • Fold/Unfold shortcut - Include keyboard shortcuts for expand/collapse all

Benefits:

  • Improved readability - Focus on specific parts of complex DAX code
  • Better navigation - Quickly jump between different sections of large formulas
  • Reduced cognitive load - Prevent code from obscuring the report canvas
  • Enhanced productivity - Especially valuable for complex measures with multiple variables and nested logic

Example Scenario: When working with a measure containing 40/50+ lines of DAX with multiple variables, nested conditions, and error handling, being able to collapse sections would significantly improve the editing experience, especially where zooming outreduces readability. This feature would align Power BI's DAX editor with modern development environment standards and greatly enhance the developer experience for complex DAX development.


No CommentsBe the first to comment

Recent ideas