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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
salexa
Helper II
Helper II

Count the number of projects with a report missing each month

Hi,

 

I have 2 tables: Projects(columns ProjectID, Status,Title)  and ProjectReports(columns ReportID, ProjectID, ReportDate, and some columns with details for each report), linked one to many - for each project we can have multiple reports.

Project Owners should add at least one report each month for a project with Status<>Closed, so I need to count projects that don't have a report added each month.

I've added some sample data for table Project:

 

DTitleStatus
1TestPowerBIIn Progress
2TestVisioClosed
3VisualIn Progress

For table ProjectReports:

ReportIDProjectIdReportDate
1106.06.2020
2109.06.2020
3101.07.2020
4115.08.2020
5111.10.2020
11201.01.2020
13205.02.2020
18215.03.2020
22222.04.2020
35305.01.2020
36305.02.2020
37305.03.2020
38316.05.2020
39322.06.2020
40301.07.2020
41302.08.2020
42305.10.2020

 

For eg, Project 3, doesn't have a report added in April and September

Could you help please? Should I create a separate table that adds a line for each month? Or is it another way to count it?(My original tables are SharePoint Tables) I've run out of ideas..

 

Thanks in advance

 

8 REPLIES 8
salexa
Helper II
Helper II

Hi @Anonymous ,

 

Yes, the month appears now, but it's not counting the project in progress, we have 0 IDs  for September( instead we hould have 2)

 

Thanks,

Irina

Anonymous
Not applicable

Hi @salexa ,

According to my understand, you want to count  months that have no reports under each Project whose status is Closed , right?

You could use the following formula after adding a Month column:

Measure =
VAR _monthPeriod =
    CALCULATE (
        MAX ( 'ProjectReports'[Month] ) - MIN ( 'ProjectReports'[Month] ),
        FILTER (
            'ProjectReports',
            'ProjectReports'[ProjectId] = MAX ( 'ProjectReports'[ProjectId] )
        )
    ) + 1
RETURN
    IF (
        MAX ( 'Projects'[Status] ) <> "Closed",
        _monthPeriod
            - CALCULATE (
                DISTINCTCOUNT ( ProjectReports[Month] ),
                FILTER (
                    'ProjectReports',
                    'ProjectReports'[ProjectId] = MAX ( 'ProjectReports'[ProjectId] )
                )
            )
    )

My visualization looks like this:

11.4.1.1.PNG

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

Hi @Anonymous ,

 

Thanks for your answer, it solves this part of business request.

Now I need to be able to have a column chart that counts all projects that are on going each month(Status is not Closed) even if the projects don't have a report added(in ProjectReports). Could you advice?ReportDate.png

 

Thanks,

Irina

Anonymous
Not applicable

Hello @salexa ,

It seems simple.

https://qiuyunus-my.sharepoint.com/:u:/g/personal/stephent01_qiuyunus_onmicrosoft_com/EX6GeFNPIsNGtR...

11.5.1.1.PNG

But it's an additional question that's off topic...

Could you tell me if your original problem has been solved? If so, here's the solution. Thank you

Best regards
Eyelyn Qin

Hi @Anonymous ,

 

September month is missing from the chart, IDss 3 and 1 are still in Progress, but don't have a report added for september.

This is what I'm struggling with, be able to count project even if no report is available for a month.

 

Thanks in advance,

Irina

Anonymous
Not applicable

Hi @salexa ,

You need to enter a new table with whole month name and number, and then add a new column using the following formula which matches the existed mouths in ProjectReport table like this:

Month =
IF (
    [No] >= MIN ( 'ProjectReports'[Month] )
        && [No] <= MAX ( 'ProjectReports'[Month] ),
    [No],
    BLANK ()
)

11.5.5.1.PNG

Then make a visual shown below after building a relationship between two tables:

11.5.5.3.PNG

11.5.5.2.PNG

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

amitchandak
Super User
Super User

@salexa , Try a measure like

measure =
var _tab= filter(summarize(ProjectReports,Project[Title], ProjectReports[Month Year], "_1", count(ProjectReports[ReportID]), "_2",count(ProjectReports[ReportID])+0), isblank(Title))
return
countx(values(_tab[Title]), max(_tab[Title]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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