Forum Discussion
MAKE SUM() IGNORE ROW CONTEXT
- 7 years ago
Anonymous - Well it is doing a SUMMARIZE so that can take some time, See if this speeds it up:
Measure 3 = VAR __date = MAX([Date]) VAR __table = SUMMARIZE(FILTER(ALL('Table4'),[Date]=__date),[Emp_no],[Date],"__hours",SUM([S_Total])/60/60) RETURN MAXX(__table,[__hours])As for the 2nd one, that should be equivalent. I created a second measure just like it and got the same results so not sure what is going on there. See attached, Table4, Page 3.
Greg_Deckler Thanks!
i have 2 more questions please :smileyhappy:
1. is it a complexed measure? it's taking some time to calculate
2. I had to write it exactly like you did. can you please explain to me whats the difference between the 2 syntax's :
VAR Table1 = SUMMARIZE(ALL('activity'),[Emp_no],[Date],"DayHours",SUM([S_Total])/3600)
VAR _Date = MAX([Date])
RETURN MAXX(FILTER(Table1,[Date]=_Date),[DayHours])this code produces the following result just like you said in the following picture:
while the following code produces a different result:
VAR Table1 = SUMMARIZE(ALL('activity'),activity[Emp_no],activity[Date],"DayHours",SUM(activity[S_Total])/3600)
VAR _Date = MAX(activity[Date])
RETURN MAXX(FILTER(Table1,[Date]=_Date),[DayHours])What is the differnce?
Anonymous - Well it is doing a SUMMARIZE so that can take some time, See if this speeds it up:
Measure 3 =
VAR __date = MAX([Date])
VAR __table = SUMMARIZE(FILTER(ALL('Table4'),[Date]=__date),[Emp_no],[Date],"__hours",SUM([S_Total])/60/60)
RETURN
MAXX(__table,[__hours])
As for the 2nd one, that should be equivalent. I created a second measure just like it and got the same results so not sure what is going on there. See attached, Table4, Page 3.
- Anonymous7 years agoNot applicable
Greg_Deckler wow! works great! thanks!