I have a sql case statement that I would like to translate into DAX.
CASE WHEN mem_type LIKE '%full%' AND mem_council = 'Council' THEN 'Full on Council'
WHEN mem_type LIKE '%full%' THEN 'Full'
WHEN mem_type LIKE '%Under%' THEN 'Under 35'
END as 'Mem_Group'
Is that possible?
Go to Solution.
SWITCH( TRUE(), AND( SEARCH ( "Full", mem_type, 1, 0 ) > 0, mem_council = "Council" ), "Full on Council"
, SEARCH ( "Full", mem_type, 1, 0 ) > 0, "Full"
, SEARCH ( "Under", mem_type, 1, 0 ) > 0, "Under 35"
View solution in original post
The SWITCH function is very similar to a SQL CASE statement. Check out the documentation here:
The syntax will be something like:
[Optional Default Value if no conditions are met]
Hope this helps,
Kudos to you if you earned one of these! Check your inbox for a notification.
Find out where you can attend!