cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
googlogmob Member
Member

SUM of SUMMARIZECOLUMNS result

I built measure to return 1 if user have made at least one calls over a day. So I have to get count of days when user tried to call

 

 

Calls = CALCULATE(COUNT(Calls[CALL_ID]);
USERELATIONSHIP(Calls[USER_ID];Users[USER_ID]);
USERELATIONSHIP(Calls[CALL_DATE];Calendar[Date]))

 

 

Period = 
VAR res = 
SUMMARIZECOLUMNS(Users[USER_ID];
		 Calendar[Date];
		 "Period";SUMX(Users;IF([Calls]>0;1;BLANK())))
RETURN res

 When I create separete table using Period measure, I get true calculation:

http://prntscr.com/hoo52e

But when i try to calculate 

SumOfPeriods = 
VAR res = 
SUMMARIZECOLUMNS(Users[USER_ID];
		 Calendar[Date];
		 "Periods";SUMX(Users;IF([Calls]>0;1;BLANK())))

RETURN SUMX(res;[Periods])

I get error:

 

 

SummarizeColumns() and AddMissingItems() may not be used in this context

Is it possible to calculate sum of SUMMARIZECOLUMNS result?
Help please

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
googlogmob Member
Member

Re: SUM of SUMMARIZECOLUMNS result

Here is answer
It was necessary to add USERELATIONSHIP in CALCULATETABLE for data-table

Periods = 
SUMX(
 SUMMARIZE(
  CALCULATETABLE(Calls;
                USERELATIONSHIP(Calls[USER_ID];Users[USER_ID]);
				USERELATIONSHIP(Calls[CALL_DATE];Calendar[Date]));
 Calendar[Date];Users[USER_ID];"Periods";IF([Calls]>0;1;BLANK()));[Periods])

 

 

1 REPLY 1
Highlighted
googlogmob Member
Member

Re: SUM of SUMMARIZECOLUMNS result

Here is answer
It was necessary to add USERELATIONSHIP in CALCULATETABLE for data-table

Periods = 
SUMX(
 SUMMARIZE(
  CALCULATETABLE(Calls;
                USERELATIONSHIP(Calls[USER_ID];Users[USER_ID]);
				USERELATIONSHIP(Calls[CALL_DATE];Calendar[Date]));
 Calendar[Date];Users[USER_ID];"Periods";IF([Calls]>0;1;BLANK()));[Periods])