cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Rolling count showing zeros for a specified time-period

Hi There,

I am trying to create an automated report that, for each month, it shows the number of incidents in the past 6 months. For that, I have two tables, a Date table (which you can see on the screenshot below), and an Incidents table such as the one shown here:

 Date Count of Incidents 30.07.2019 2 22.07.2019 1 18.07.2019 1 04.07.2019 1 17.06.2019 1 24.05.2019 1 07.05.2019 1 28.03.2019 1 27.03.2019 1 05.02.2019 1 09.04.2018 1 05.02.2018 1 26.10.2017 1 05.07.2017 1 20.06.2017 1 18.01.2017 1

The formulas I am using to make the plot are as follows:

Measure for the Y axis:

``````Incidents_last_6Months =
CALCULATE(
COUNTROWS(Incidents),
DATESINPERIOD('Date'[Date], [Max Date], -6, MONTH)
)``````

Calculated column that provides the X axis for the plot:

``Year Month = RELATED('Date'[Year Month])``

My current problem is that I would like it to show zeros for the months that were zero incidents. I have tried to put a "+0" in the DAX formula "Incidents_last_6Months", but then it shows the whole period (from 2017 to 2019), filled up with zeros.

Does anybody have a solution for such issues?

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Rolling count showing zeros for a specified time-period

Hi perm

You could refer to my sample to see whether it work or not.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Community Support Team

## Re: Rolling count showing zeros for a specified time-period

Hi perm,

According to your description, it seems that when you add 0 , it will apply for all date, right? If so, you could try to refer to my sample to see whether it work or not.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

## Re: Rolling count showing zeros for a specified time-period

Hi Zoe Zhi,

Thank you very much for your answer! I actually tried to add the zero, but it did not work. I checked your sample, and it does not quite apply.

I made a sample file with two different approaches to the problem (one on each tab). You can find the file under this link: https://drive.google.com/file/d/1U7vMhGDYFiGyndUeUFlCQDt3wplScgp1/view?usp=drivesdk

Hopefully, this can explain my case better.

Best regards,

Marti

Community Support Team

## Re: Rolling count showing zeros for a specified time-period

Hi perm

You could refer to my sample to see whether it work or not.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

## Re: Rolling count showing zeros for a specified time-period

Hi dax,

Thank you very much, this is definitely what I was looking for!

I realised I was totally missing the second "slicer" table 🙂

Best regards,

Marti

Announcements

#### New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

#### Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

#### Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

#### Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)