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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
hodobee
New Member

aggregate chart

Hi!

I have a problem I can't solve. I have a January aggregate chart and a February aggregate chart. If January and February are selected together in the filter it works fine. However, if I select only February, then the slices where there was no value for January are dropped. I have turned off the interaction between the filter and the chart and put a measure on the max date, but that way it counts with the max date, not February.
Or it doesn't work with that either:

 

calc_chart =
VAR max_month = Max('A'[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]))

)))
January:januaryjanuary

January+February74fef651-e050-4e02-805d-e320a76682cc.png
Just February, dropped 2 slice 😞februaryfebruary
Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vjiewumsft_0-1736993595154.png

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.

vjiewumsft_0-1736993595154.png

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.