Hi all.
Would really appreciate someone taking a look to see where I am butchering this expression to determine a default starting view.
I have 3 outcomes,
The error is:
Condition OR(IN(โObligation Team POCโ,CurrentUserRights[UserViewsSelection]), IN(โNLO Working Groupโ,CurrentUserRights[UserViewsSelection]), IN(โAccountable Executive Business Ownerโ,CurrentUserRights[UserViewsSelection]), โPortfolioโ) has an invalid structure: subexpressions must be Yes/No conditions
Thank you.
IF
(NOT(IN(USEREMAIL(),Users[Useremail])),Register,
IF(OR(
IN("Obligation Team POC",CurrentUserRights[UserViewsSelection]),
IN("NLO Working Group", CurrentUserRights[UserViewsSelection]),
IN("Accountable Executive Business Owner", CurrentUserRights[UserViewsSelection]), Portfolio)),
IF(OR(
IN("NLO PMO", CurrentUserRights[UserViewsSelection]),
IN("Both NLO PMO and NLO Working Group", CurrentUserRights[UserViewsSelection]),Portfolio - All Status)
))
Solved! Go to Solution.
I think your parentheses are in the wrong places. Try the following. And in a moment I will update this post with a shorter expression to accomplish the same thing.
IF
(NOT(IN(USEREMAIL(),Users[Useremail])),"Register",
IF(OR(
IN("Obligation Team POC",CurrentUserRights[UserViewsSelection]),
IN("NLO Working Group", CurrentUserRights[UserViewsSelection]),
IN("Accountable Executive Business Owner", CurrentUserRights[UserViewsSelection])), "Portfolio",
IF(OR(
IN("NLO PMO", CurrentUserRights[UserViewsSelection]),
IN("Both NLO PMO and NLO Working Group", CurrentUserRights[UserViewsSelection])),"Portfolio - All Status")
))
Ok, maybe not way shorter yet, but using IFS instead of nested IF minimizes the nesting parentheses complications. Iโm guessing you have a slice โCurrentUserRightsโ that only shows the โUsersโ record for the current user? And is there only ever 1 โUsersโ record per user? Is the [UserViewsSelection] column a single selection, or an EnumList?
IFS(
NOT( IN( USEREMAIL() , Users[Useremail] ) ) ,
"Register" ,
OR(
IN("Obligation Team POC",CurrentUserRights[UserViewsSelection]),
IN("NLO Working Group", CurrentUserRights[UserViewsSelection]),
IN("Accountable Executive Business Owner", CurrentUserRights[UserViewsSelection])
) ,
"Portfolio" ,
OR(
IN("NLO PMO", CurrentUserRights[UserViewsSelection]),
IN("Both NLO PMO and NLO Working Group", CurrentUserRights[UserViewsSelection])
) ,
"Portfolio - All Status"
)
I think your parentheses are in the wrong places. Try the following. And in a moment I will update this post with a shorter expression to accomplish the same thing.
IF
(NOT(IN(USEREMAIL(),Users[Useremail])),"Register",
IF(OR(
IN("Obligation Team POC",CurrentUserRights[UserViewsSelection]),
IN("NLO Working Group", CurrentUserRights[UserViewsSelection]),
IN("Accountable Executive Business Owner", CurrentUserRights[UserViewsSelection])), "Portfolio",
IF(OR(
IN("NLO PMO", CurrentUserRights[UserViewsSelection]),
IN("Both NLO PMO and NLO Working Group", CurrentUserRights[UserViewsSelection])),"Portfolio - All Status")
))
Ok, maybe not way shorter yet, but using IFS instead of nested IF minimizes the nesting parentheses complications. Iโm guessing you have a slice โCurrentUserRightsโ that only shows the โUsersโ record for the current user? And is there only ever 1 โUsersโ record per user? Is the [UserViewsSelection] column a single selection, or an EnumList?
IFS(
NOT( IN( USEREMAIL() , Users[Useremail] ) ) ,
"Register" ,
OR(
IN("Obligation Team POC",CurrentUserRights[UserViewsSelection]),
IN("NLO Working Group", CurrentUserRights[UserViewsSelection]),
IN("Accountable Executive Business Owner", CurrentUserRights[UserViewsSelection])
) ,
"Portfolio" ,
OR(
IN("NLO PMO", CurrentUserRights[UserViewsSelection]),
IN("Both NLO PMO and NLO Working Group", CurrentUserRights[UserViewsSelection])
) ,
"Portfolio - All Status"
)
Spot on, thank you.
Yes - there is only ever 1 users record per user with [UserViewsSelection] a single selection.
You should be able to reduce the expression to this then:
IFS(
NOT( IN( USEREMAIL() , Users[Useremail] ) ) ,
"Register" ,
IN(
ANY( CurrentUserRights[UserViewsSelection] ) ,
LIST( "Obligation Team POC", "NLO Working Group" , "Accountable Executive Business Owner" )
) ,
"Portfolio" ,
IN(
ANY( CurrentUserRights[UserViewsSelection] ) ,
LIST( "NLO PMO" , "Both NLO PMO and NLO Working Group" )
) ,
"Portfolio - All Status"
)
Thank you, @Marc_Dillon!
User | Count |
---|---|
33 | |
30 | |
30 | |
19 | |
17 |