cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
perm Frequent Visitor
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:

 

DateCount of Incidents
30.07.20192
22.07.20191
18.07.20191
04.07.20191
17.06.20191
24.05.20191
07.05.20191
28.03.20191
27.03.20191
05.02.20191
09.04.20181
05.02.20181
26.10.20171
05.07.20171
20.06.20171
18.01.20171

 

image.png

 

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
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.

 

View solution in original post

4 REPLIES 4
Community Support Team
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.

 

perm Frequent Visitor
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
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.

 

View solution in original post

perm Frequent Visitor
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

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

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

MBAS 2020

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

Difinity Conference

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

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)