Forum Discussion
tomperro
9 months agoHelper V
UDF Question
I created a User Defines Function and it seems to be working but when I use it in a measure, it is retunring an incorrect value. Here is my function: function fnFYTDAverage = ...
- 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 )
DaleT
9 months agoResolver II
Hi
Based on a quick look, the DiscussedFYTD should be fnFYTDAverage([~PercentDiscussedWithEmployee]), is this the cause?