Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I'm trying to implement the Page Level Security Workaround in Power BI from RADACAD, but i'm running into an error:
A table of multiple values was supplied where a single value was expected.
The dax synthax that i'm using is the one below. And I'm guessing the error comes from var _LookUpSecurity. I have a table with all the user principal names(UPN) and the reports that they allowed to view. So if I lookup the value "10.001 Order Book" then it returns with a list of the UPN's.
Measure =
var _SalesAV=SUM('SD SalesDocumentItems'[Net Value Base Currency])
var _LookUpSecurity=LOOKUPVALUE('Page Navigation UPN'[group.member.userPrincipalName],'Page Navigation UPN'[Report ],"10.001 Order Book")
return
if(_LookUpSecurity=[User Logged In],_SalesAV)
Solved! Go to Solution.
Hi @Kpham ,
You can update the measure as below and check if it can work...
Measure = VAR _SalesAV = SUM ( 'SD SalesDocumentItems'[Net Value Base Currency] ) VAR _LookUpSecurity = CALCULATE ( MAX ( 'Page Navigation UPN'[group.member.userPrincipalName] ), FILTER ( 'Page Navigation UPN', 'Page Navigation UPN'[Report ] = "10.001 Order Book" ) ) RETURN IF ( _LookUpSecurity = [User Logged In], _SalesAV ) |
And if the table 'Page Navigation UPN' have multiple [group.member.userPrincipalName] values when the value of field [Report ] is "10.001 Order Book", please update it as below:
Measure = VAR _SalesAV = SUM ( 'SD SalesDocumentItems'[Net Value Base Currency] ) VAR _LookUpSecurity = CALCULATETABLE ( VALUES ( 'Page Navigation UPN'[group.member.userPrincipalName] ), FILTER ( 'Page Navigation UPN', 'Page Navigation UPN'[Report ] = "10.001 Order Book" ) ) RETURN IF ( [User Logged In] IN _LookUpSecurity, _SalesAV ) |
If the above one can't help you get the desired result, please provide some sample data in your tables 'SD SalesDocumentItems' and 'Page Navigation UPN' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards
@Kpham , Try like
Measure =
var _SalesAV=SUM('SD SalesDocumentItems'[Net Value Base Currency])
var _LookUpSecurity=Maxx(filter('Page Navigation UPN', 'Page Navigation UPN'[Report ],"10.001 Order Book"),'Page Navigation UPN'[group.member.userPrincipalName])
return
if(_LookUpSecurity=[User Logged In],_SalesAV)
Hello, thanks for looking into it but unfortunately not the solution
Hi @Kpham ,
You can update the measure as below and check if it can work...
Measure = VAR _SalesAV = SUM ( 'SD SalesDocumentItems'[Net Value Base Currency] ) VAR _LookUpSecurity = CALCULATE ( MAX ( 'Page Navigation UPN'[group.member.userPrincipalName] ), FILTER ( 'Page Navigation UPN', 'Page Navigation UPN'[Report ] = "10.001 Order Book" ) ) RETURN IF ( _LookUpSecurity = [User Logged In], _SalesAV ) |
And if the table 'Page Navigation UPN' have multiple [group.member.userPrincipalName] values when the value of field [Report ] is "10.001 Order Book", please update it as below:
Measure = VAR _SalesAV = SUM ( 'SD SalesDocumentItems'[Net Value Base Currency] ) VAR _LookUpSecurity = CALCULATETABLE ( VALUES ( 'Page Navigation UPN'[group.member.userPrincipalName] ), FILTER ( 'Page Navigation UPN', 'Page Navigation UPN'[Report ] = "10.001 Order Book" ) ) RETURN IF ( [User Logged In] IN _LookUpSecurity, _SalesAV ) |
If the above one can't help you get the desired result, please provide some sample data in your tables 'SD SalesDocumentItems' and 'Page Navigation UPN' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |