Forum Discussion
UDF Question
- 9 months ago
It seems you missed a definition of the parameter. Refer to the function code below, please. The function can accept a measure in this way ": anyref expr" rather than considering it as a scalar. Please also refer to doc here https://learn.microsoft.com/en-us/dax/best-practices/dax-user-defined-functions#type
DEFINE FUNCTION fnFYTDAverage_new = (_measure: anyref expr) => AVERAGEX( DATESYTD(DateTable[Datekey]), _measure )
Hi
Based on a quick look, the DiscussedFYTD should be fnFYTDAverage([~PercentDiscussedWithEmployee]), is this the cause?
- tomperro9 months agoHelper V
Yes, that ls what I have in the pbix, I updated my original post
- DaleT9 months agoResolver II
It seems you missed a definition of the parameter. Refer to the function code below, please. The function can accept a measure in this way ": anyref expr" rather than considering it as a scalar. Please also refer to doc here https://learn.microsoft.com/en-us/dax/best-practices/dax-user-defined-functions#type
DEFINE FUNCTION fnFYTDAverage_new = (_measure: anyref expr) => AVERAGEX( DATESYTD(DateTable[Datekey]), _measure )