Forum Discussion
Error on using UserName() function in custom table
- 8 years ago
Hi pratk30,
As we can see from the error message, it isn't supported. What's your purpose? Maybe there are other approaches. For example, we can use a measure like this, then we can filter out these 0s in the Filters.
Measure = CALCULATE ( IF ( MIN ( 'AssignmentTimephasedDataSet'[ResourcesOwner.ResourceEmailAddress] ) = USERNAME (), 1, 0 ) )Best Regards,
Dale
Hi pratk30,
As we can see from the error message, it isn't supported. What's your purpose? Maybe there are other approaches. For example, we can use a measure like this, then we can filter out these 0s in the Filters.
Measure =
CALCULATE (
IF (
MIN ( 'AssignmentTimephasedDataSet'[ResourcesOwner.ResourceEmailAddress] )
= USERNAME (),
1,
0
)
)Best Regards,
Dale
v-jiascu-msft wrote:Hi pratk30,
For example, we can use a measure like this, then we can filter out these 0s in the Filters.
Measure = CALCULATE ( IF ( MIN ( 'AssignmentTimephasedDataSet'[ResourcesOwner.ResourceEmailAddress] ) = USERNAME (), 1, 0 ) )Best Regards,
Dale
Fortunately, I got this to work for me, but I find it rather unintiutive... My beginner DAX mind says the following should have been sufficient:
IsCurrentUser = 'AssignmentTimephasedDataSet'[ResourcesOwner.ResourceEmailAddress] = USERNAME()
Unfortunately, DAX does not seem very intuitive as far as I can tell.