Forum Discussion
acg
Resolver I
3 years agoConditional statements across different tables
I have two tables looking at schemes and their activity levels. I need to create a new variable (Retail / Default) that takes different conditional scenarios across these two tables into account. ...
- 3 years ago
After some discussion in the team, this is the solution:
Scheme type = VAR ActiveDefault = 'Question Library KSAR'[Active/Default] VAR RestrictedStatus = RELATED('Scheme'[Restricted Scheme Name]) RETURN SWITCH( TRUE(), ActiveDefault = "Active" && RestrictedStatus = "Yes", "Restricted", ActiveDefault = "Active" && RestrictedStatus = "No", "Retail", ActiveDefault = "Default" && RestrictedStatus = "Yes", "Restricted", ActiveDefault = "Default" && RestrictedStatus = "No", "Default", "Retail" )
acg
Resolver I
3 years agoAfter some discussion in the team, this is the solution:
Scheme type =
VAR ActiveDefault = 'Question Library KSAR'[Active/Default]
VAR RestrictedStatus = RELATED('Scheme'[Restricted Scheme Name])
RETURN
SWITCH(
TRUE(),
ActiveDefault = "Active" && RestrictedStatus = "Yes", "Restricted",
ActiveDefault = "Active" && RestrictedStatus = "No", "Retail",
ActiveDefault = "Default" && RestrictedStatus = "Yes", "Restricted",
ActiveDefault = "Default" && RestrictedStatus = "No", "Default",
"Retail"
)