Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
googlogmob
Advocate II
Advocate II

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
googlogmob
Advocate II
Advocate II

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])

 

 

View solution in original post

1 REPLY 1
googlogmob
Advocate II
Advocate II

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])

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.