If the allow unrestricted measures for DirectQuery mode setting is enabled in Power BI Desktop, all DAX functions can be used in measures. However, only certain DAX functions are natively converted to SQL expressions for execution by the source system. The list of these optimized functions is available in the MS documentation: http://bit.ly/2oK8QXB. To the greatest extent possible, dataset designers should ensure that optimized functions are leveraged in measures and that non-optimized functions are only used on small, pre-filtered or aggregated query results.