Calculated Member MDX Expression Syntax

I am trying to build a calculated member based on logic that depends on values for a given dimension attribute.  How would I go about building the expression?  For example if a given attribute value is 'A' then I want to count an existing measure towards this calculated member.  Any sample code would be helpful.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Reza RadConsultant, TrainerCommented:
you can use case expression for conditional expressions, look at here for example:

Reza RadConsultant, TrainerCommented:
all types of mdx conditional expressions are here:
anguptaAuthor Commented:
These examples use measures only,  I need to use attribute values in the case statement.  I tried doing this before however I am unable to read in the values the attributes.
Reza RadConsultant, TrainerCommented:
you can get values as below:

let me know if i am wrong in understanding your problem
Megan BrooksSQL Server ConsultantCommented:
Show us something you tried that didn't work, or elaborate on what you are trying to do. I ran a quick test with a query in this form and it worked just fine:

with member Measures.chooseone as case [Dim].[Hier] when [Dim].[Hier].&[1] then [Measures].[M1] when [Dim].[Hier].&[2] then [Measures].[M2] when [Dim].[Hier].&[3] then [Measures].[M3] end
select {measures.chooseone} on columns, [Dim].[Hier2].[Hier2] on rows from [Cube]

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.