Forum Discussion
Problem with ALL/ALLSELECTED while creating a heatmap
- Anonymous1 year ago
Hi Anonymous ,
Please update the formula of your measure [heatmap] as below and check if it can return the correct result. Please find the details in the attachment.
heatmap = VAR __tbl = CALCULATETABLE ( SUMMARIZECOLUMNS ( 'd_calendar'[week_en_us], 'd_calendar'[day_name_en_us_with_day_name], 'd_hours'[day_moment], 'd_hours'[hour], "@count_ticket",[count_tickets] ), ALLSELECTED(), VALUES('d_calendar'[week_en_us]) ) VAR __result = MAXX ( __tbl, [@count_ticket] ) RETURN __resultBest Regards
Hi Anonymous ,
Please update the formula of your measure [heatmap] as below and check if it can return the correct result. Please find the details in the attachment.
heatmap =
VAR __tbl =
CALCULATETABLE (
SUMMARIZECOLUMNS (
'd_calendar'[week_en_us],
'd_calendar'[day_name_en_us_with_day_name],
'd_hours'[day_moment],
'd_hours'[hour],
"@count_ticket",[count_tickets]
),
ALLSELECTED(),
VALUES('d_calendar'[week_en_us])
)
VAR __result =
MAXX ( __tbl, [@count_ticket] )
RETURN
__result
Best Regards
Hey, Anonymous . Thanks a lot, that's exactly what I was trying to do 😃
Could you help me understand the reasoning used in the formula, please? Up to the ALLSELECTED() is fine to me, but what is the reason for using the VALUES() over the week column?
Once again, thanks for your help.
- Anonymous1 year agoNot applicable
Hi Anonymous ,
The **VALUES('d_calendar'[week_en_us])** function is utilized to ensure that the calculation is performed for each individual week. This maintains the filter context for [week_en_us] from the outer environment, thereby ensuring that any filters applied to weeks are respected when the table is generated using SUMMARIZECOLUMNS.
Best Regards