Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
115 | |
105 | |
95 | |
79 | |
72 |