I have the following measure, which although a bit hairy works well. The problem is that I need to add a second USERELATIONSHIP to bring in another dimension. I know how to do that by adding a ,USERELATIONSHIP in each filter. The problem is I need to do that 8 times, and I have quite a few measures like this. So I was thinking about how I could encapsulate the 2 USERELATIONSHIPS into some kind of "subroutine". I thought I could do some kind of measure with do nothing filter including them, but apart from not being sure of the syntax it probably wouldn't work because as soon as the measure is evaluated the relationships would flip back. Maybe some kind of measure above this that calls this, but how to do that. Or is there an alternative way of expressing this where the switch is called one, but I don't think I can put a switch in a calculation. Any thoughts on how to handle this. Sorry for the format, for some reason a carriage return does not work for me in this editor. - Pete Post Sum of Member Months:=switch([Slicer],
1, (calculate(Bridges[Sum of BTH Member Months],filter(AllSelected(Bridges),Bridges[MemberMonths]>=[Post Min]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) -
(calculate(Bridges[Sum of BTH Member Months],filter(AllSelected(Bridges),Bridges[MemberMonths]>[Post Max]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) +
(calculate(Bridges[Count of BTH Members]* [Post Max],filter(AllSelected(Bridges),Bridges[MemberMonths]>[Post Max]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) -
(calculate(Bridges[Count of BTH Members]*([Post Min] -1),filter(AllSelected(Bridges),Bridges[MemberMonths]>=[Post Min]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) ,
2, (calculate(HealthCoach[Sum of HC Member Months],filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>=[Post Min]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) -
(calculate(HealthCoach[Sum of HC Member Months],filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>[Post Max]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) +
(calculate(HealthCoach[Count of HC Members]* [Post Max],filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>[Post Max]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) -
(calculate(HealthCoach[Count of HC Members]*([Post Min] -1),filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>=[Post Min]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) ,
BLANK())
1, (calculate(Bridges[Sum of BTH Member Months],filter(AllSelected(Bridges),Bridges[MemberMonths]>=[Post Min]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) -
(calculate(Bridges[Sum of BTH Member Months],filter(AllSelected(Bridges),Bridges[MemberMonths]>[Post Max]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) +
(calculate(Bridges[Count of BTH Members]* [Post Max],filter(AllSelected(Bridges),Bridges[MemberMonths]>[Post Max]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) -
(calculate(Bridges[Count of BTH Members]*([Post Min] -1),filter(AllSelected(Bridges),Bridges[MemberMonths]>=[Post Min]),USERELATIONSHIP(Bridges[EnrollDate],InterventionDate[iDate]))) ,
2, (calculate(HealthCoach[Sum of HC Member Months],filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>=[Post Min]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) -
(calculate(HealthCoach[Sum of HC Member Months],filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>[Post Max]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) +
(calculate(HealthCoach[Count of HC Members]* [Post Max],filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>[Post Max]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) -
(calculate(HealthCoach[Count of HC Members]*([Post Min] -1),filter(AllSelected(HealthCoach),HealthCoach[MemberMonths]>=[Post Min]),USERELATIONSHIP(HealthCoach[EnrollDate],InterventionDate[iDate]))) ,
BLANK())