Applying M transformations with DirectQuery models

  • The M transformation functions supported in DirectQuery are limited by compatibility with the source system. The Query Editor will advise when a transformation is not supported in DirectQuery mode per Figure 32.
Figure 28: A warning in Query Editor that the IsEven M function is not supported in DirectQuery Mode
  • Given this limitation and the additional complexity the M-based transforms would add to the solution, it's recommended to embed all the necessary logic and transforms in the source relational layer.
  • Ideally, the base tables in the source database themselves would reflect these needs. As a secondary option, the layer of views used to support the DirectQuery Model can be modified as well to incorporate new or additional logic.
  • If the database objects themselves cannot be revised, the Value.Native() M function can be used to directly pass the SQL statement from Power BI Desktop to the source database as per Figure 29.
Figure 29: The Value.Native() function used to pass a SQL statement to a source system