Forum Discussion
SWITCH ( TRUE() ) with multiple criteria?
- 6 years ago
@aharon0414 - I usually do not see calculate statements in a SWITCH(TRUE()...) statement. SWITCH is usually like:
SWITCH(TRUE(), 'Vendor'[VENDORNAME] = "jim" && 'Vendor'[Vendor Billable] > 300000, <some calc>, 'Vendor'[VENDORNAME] = "jim" && 'Vendor'[Vendor Billable] > 150000, <some calc>, <some calc> )
@aharon0414 - I usually do not see calculate statements in a SWITCH(TRUE()...) statement. SWITCH is usually like:
SWITCH(TRUE(),
'Vendor'[VENDORNAME] = "jim" && 'Vendor'[Vendor Billable] > 300000, <some calc>,
'Vendor'[VENDORNAME] = "jim" && 'Vendor'[Vendor Billable] > 150000, <some calc>,
<some calc>
)- parry2k6 years ago
Super User
Anonymous it can be easily achieved by measures, if you put sample data in pbix file, it will help and I don't think SWITCH is the answer here, I could be totally wrong.
- Anonymous6 years agoNot applicable
Thank you Greg_Deckler !
That seemed to get me a step forward. SWITCH (True) ) is working now, but in my variables, it will only calculate based on the first variables created. My variables all reference another variable that transitions the context between respective vendors, but that is not carrying forward in the totality of the SWITCH statement. I'll try to work up a mockup to share, but for now, my data is confidential and it may be a lot of work to put something together.