Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi guys,
I'm currently unable to show the top 2 'calls' (just a number in a table) specified to the User currently logged in, by using USERNAME(). With the current logic I came up with I receive the following error:
"CUSTOMDATA, USERNAME, USERCULTURE and USERPRINCIPALNAME functions are not supported in calculated tables/columns. These functions may only be used in Measures or in the AllowedRowsExpression."
This is the result I want to achieve (also within included PBIX File).
The Green box is the result I want to achieve, but currently the Red box is where the error shows up when using USERNAME(), because in the example below uses the string "Irene" instead of USERNAME().
UserName = "Irene" --because with USERNAME() the other measures crash
This is the DAX I use:
CallsPerUser_FilterMsr =
CALCULATE(
SUM(CallsPerUser[CallsPerUser_Filter]),
FILTER(CallsPerUser, CallsPerUser[User] = [UserName]))
CallsRank =
RANKX(ALL(CallsPerUser),[CallsPerUser_FilterMsr],,DESC,Skip)
Calls Top 2 = CALCULATE([CallsPerUser_FilterMsr],FILTER(CallsPerUser,[CallsRank]<=2))
Also using visual level filter with Top N doesn't work with what I tried, because you'll get the reports with in general the highest Calls, instead of specified to the user.
Any suggestions / workarounds?
Kind regards,
Igor
Solved! Go to Solution.
@Titatovenaar2 , change this one and then try and visual level filter on CallsRank
CallsRank =
RANKX(ALLselected(CallsPerUser[Report]),[CallsPerUser_FilterMsr],,DESC,Skip)
r
@Titatovenaar2 , change this one and then try and visual level filter on CallsRank
CallsRank =
RANKX(ALLselected(CallsPerUser[Report]),[CallsPerUser_FilterMsr],,DESC,Skip)
r