Forum Discussion
Anonymous
6 years agoNot applicable
SWITCH ( TRUE() ) with multiple criteria?
I'm trying to perform a calculation that will render costs charged by multiple vendors across multiple products and then get a grand total. Maybe I'm trying to do too much up front, but here's where ...
- 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> )
Greg_Deckler
Community Champion
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>
)Anonymous
6 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.