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> )
amitchandak
Super User
6 years agoAnonymous , Switch true will work but i doubt syntax you use refer example
Switch([age_group]
, "AgeGRoup_0-4" , 1
, "AgeGroup_5-9" , 2
, "AgegRoup_10-14" ,3
, "AgegRoup_15-19" , 4
, "AgegRoup_20-24" , 5
, "AgegRoup_25-29" , 6
7
)
or
Switch([age_group]
, "AgeGRoup_0-4" && [ABC] =4 || [def] =4 , 1
, "AgeGroup_5-9" , 2
, "AgegRoup_10-14" ,3
, "AgegRoup_15-19" , 4
, "AgegRoup_20-24" , 5
, "AgegRoup_25-29" , 6
7
)