Do you mean the DAX measure created in Power BI Desktop? If yes, I cannot repro the same issue as you. I can configure the on-premises gateway properly and the measure can be displayed in Power BI Service. The refresh is also successful.
Yes, it is a DAX measure created in Power BI Desktop and shows the discount on sales price of a product.
In the Power BI Desktop everything runs smoothly, also the refreshing process. I can publish this report in Power BI Service, this runs also without any error. But as soon as it comes to refresh, I got this error...