Forum Discussion
aggregate chart
- Anonymous1 year ago
Hi hodobee ,
Based on the testing, creating the date table to filter the chart.
Dates = CALENDAR(MIN('A'[date]), MAX('A'[date]))Then, try using the following DAX formula to calculate the aggregate based on the selected month.
calc_chart = VAR max_month = MAX('Dates'[Date]) RETURN CALCULATE( DISTINCTCOUNT('A'[Number]), FILTER( ALL('A'), 'A'[Result] = "closed" && 'A'[Date] <= max_month && (ISBLANK(SELECTEDVALUE('A'[where])) || 'A'[where] = SELECTEDVALUE('A'[where])) && (ISBLANK(SELECTEDVALUE('A'[Year])) || 'A'[Year] = SELECTEDVALUE('A'[Year])) ) )Drag the date table month column to the slicer visual.
Select the month. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi hodobee ,
Based on the testing, creating the date table to filter the chart.
Dates = CALENDAR(MIN('A'[date]), MAX('A'[date]))
Then, try using the following DAX formula to calculate the aggregate based on the selected month.
calc_chart =
VAR max_month = MAX('Dates'[Date])
RETURN
CALCULATE(
DISTINCTCOUNT('A'[Number]),
FILTER(
ALL('A'),
'A'[Result] = "closed" &&
'A'[Date] <= max_month &&
(ISBLANK(SELECTEDVALUE('A'[where])) || 'A'[where] = SELECTEDVALUE('A'[where])) &&
(ISBLANK(SELECTEDVALUE('A'[Year])) || 'A'[Year] = SELECTEDVALUE('A'[Year]))
)
)
Drag the date table month column to the slicer visual.
Select the month. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.