I need to get calculated measure values based on conditions.
Am having the below data in my cube
I have created below calculated measure using IIF() function
IF([Title] = "Sales Representative",[Reseller Order Count],0)
I have tried with below query:
WITH
MEMBER [Measures].[Expression1] AS IIF([EMPLOYEE].[TITLE].CURRENTMEMBER.MEMBERVALUE = "SALES REPRESENTATIVE",[Reseller Order Count],0) SELECT{
[Measures].[Expression1]} ON COLUMNS FROM [Sales Targets] CELL PROPERTIES VALUE, FORMATTED_VALUE, FORMAT_STRING
It returns 0 but the value returned must be 3693
But while using dimension field in the above query, it returns value for that particular Title and remaining Titles has 0.
WITH
MEMBER [Measures].[Expression1] AS IIF([EMPLOYEE].[TITLE].CURRENTMEMBER.MEMBERVALUE = "SALES REPRESENTATIVE",[Reseller Order Count],0) SELECT{
[Measures].[Expression1]} ON COLUMNS ,NONEMPTY((TOPCOUNT(
(Order((([Employee].[Title].[Title].ALLMEMBERS)),[Employee].[Title].CurrentMember.MemberValue,ASC)),101)),{
[Measures].[Expression1]}) ON ROWS FROM [Sales Targets] CELL PROPERTIES VALUE, FORMATTED_VALUE, FORMAT_STRING
Is there any way to get the result without using dimension field in the MDX query?
I have checked multiple solutions in StackOverFlow and tried but none has achieved my requirement. Can anyone please guide me to get the required value?