Forum Discussion
Issue with Bar chart: SummarizeColumns() and AddMissingItems() may not be used in this context
- 6 years ago
It's probably becuase the Location column is in both the visual and the SUMMARIZECOLUMNS(). When SUMMARIZECOLUMNS() throws an error, I sometimes use its less error prone predecessor ADDCOLUMNS(SUMMARIZE(). Here is that version of your measure:
Count_Over40 =
VAR tablex =
FILTER (
ADDCOLUMNS (
SUMMARIZE (
'Timecard Swipes',
'Date'[WeekNum_Year],
'Timecard Swipes'[Employee_ID],
'Timecard Swipes'[Location]
),
"XXHours", CALCULATE ( SUM ( 'Timecard Swipes'[Work_Hours] ) )
),
[XXHours] > 40
)
RETURN
CALCULATE ( COUNTROWS ( tablex ) ) + 0If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
It's probably becuase the Location column is in both the visual and the SUMMARIZECOLUMNS(). When SUMMARIZECOLUMNS() throws an error, I sometimes use its less error prone predecessor ADDCOLUMNS(SUMMARIZE(). Here is that version of your measure:
VAR tablex =
FILTER (
ADDCOLUMNS (
SUMMARIZE (
'Timecard Swipes',
'Date'[WeekNum_Year],
'Timecard Swipes'[Employee_ID],
'Timecard Swipes'[Location]
),
"XXHours", CALCULATE ( SUM ( 'Timecard Swipes'[Work_Hours] ) )
),
[XXHours] > 40
)
RETURN
CALCULATE ( COUNTROWS ( tablex ) ) + 0
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years agoNot applicable
yes, this works.
Thanks much.