DAX to SQL Translation for Metric Views
Translation Decision Framework
For each DAX measure, classify it into one of these categories:
- Translatable (direct):
SUM,COUNT,AVERAGE,MIN,MAXon columns -> atomic measure. - Translatable (composed):
DIVIDE, ratio of measures -> composed measure usingMEASURE(). - Translatable (filtered):
CALCULATE(SUM(...), FILTER(...))-> measure withFILTER (WHERE ...)clause. - Architecture change needed:
SWITCH/SELECTEDVALUEslicer patterns -> replace with dimensions. - Dashboard-layer:
ISFILTERED,CONCATENATEX,FORMAT,NAMEOF-> skip, document as display-only. - Not translatable:
ALLSELECTED,USERELATIONSHIP, certain time-intelligence -> flag for review. - Out of scope:
EXTERNALMEASURE, DirectQuery references -> flag.
For the complete pattern catalog, read PATTERNS.md. For patterns that cannot be translated, read UNSUPPORTED.md. For edge cases and gotchas, read EDGE_CASES.md.