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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Issue with Completed Projects Count Measure for Year-Month Line Chart

Hello,

I need help creating a measure to accurately count completed projects in a Year-Month line chart. Here's a sample of my data from the fact table:

Project Date To Client Employee Status StatusBasedOnMaxDateTimeColumn

ProjectA01-10-202408:00CEALewisIn ProgressCompleted
ProjectA05-10-202417:32CEALewisCompletedCompleted
ProjectA15-11-202419:00JRVettelIn ProgressCompleted
ProjectA15-11-202420:00JRVettelCompletedCompleted
ProjectB02-10-202406:04RACLeclercIn ProgressIn Progress
ProjectB03-10-202413:31RACLeclercCompletedIn Progress
ProjectB19-10-202401:15DOCMaxIn ProgressIn Progress
ProjectB01-11-202419:00DOCMaxIn ProgressIn Progress

 

Explanation:

  • I have a calculated column, StatusBasedOnMaxDateTimeColumn, which returns the overall status of a project based on the maximum datetime entry for that project.
  • For example, since the latest status for ProjectA is "Completed," all entries for ProjectA show "Completed" in the calculated column.
  • This calculated column ensures that the StatusBasedOnMaxDateTimeColumn  column always reflects the final status of a project.

    Current Measure:

    Completed Projects Count =
    CALCULATE(
    DISTINCTCOUNT('T1'[Project]),
    FILTER(
    'T1',
    [StatusBasedOnMaxDateTimeColumn] = "Completed"
    )
    )

    Issue:

    • The above measure works perfectly in a card visual, and the count matches the count of "Completed" status in a table visual.
    • However, when I use this measure in a Year-Month line chart, the same project is counted multiple times if it appears across different months.
      • For example, ProjectA is counted as completed in October 2024 and again in November 2024.
    • The goal is to aggregate the completed project count in the line chart so it matches the "Completed" status count in the table visual.

      Additional Requirements:

      • The measure should respect slicers for Client, Employee, and Project, but it should count projects only once based on the final status, regardless of the month where it appears.


        Expected output in the line chart:

        Overall(without Selection)
        YearMonthCompleted Projects Count
        2024oct 
        2024Nov1
        Total1

        If Client:CEA Selected
        YearMonthCompleted Projects Count
        2024oct 
        2024Nov1
        Total1


        If Client:JR Selected
        YearMonthCompleted Projects Count
        2024oct 
        2024Nov1
        Total1


        Table visual:
        Gokul_Saraboji_0-1741779866621.png



        I have also attached the PBIX file with sample data.

        https://drive.google.com/drive/folders/1BgYc53Bvcz2OHlg61EeXY5bRWoR2l06X 

        Any guidance on how to adjust my measure to achieve this would be greatly appreciated!

        Thank you!









5 REPLIES 5
v-csrikanth
Community Support
Community Support

Hi @Anonymous 

We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please Accept as Solution to help others benefit in the community.
Thank you.

If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @Anonymous 

Thank you for being part of the Microsoft Fabric Community.

As highlighted by @dk_dk , the proposed approach appears to effectively address your requirements. Could you please confirm if your issue has been resolved?
If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.

Best Regards,
Cheri Srikanth

dk_dk
Super User
Super User

Hi @Anonymous 

If I understand your problem correctly, you should just be able to add a visual level filter to your line chart with the condition Status = "Completed" (the original status column not your calculated column) and that should result in a line chart that only counts projects that are completed, in the month they were completed.

Alternatively, if you need to have the "latest status" and not just the completed ones, you could create an other calculated column called Latest Status Date that would for each project look up the Date on which Status = StatusBasedOnMaxDateTimeColumn, and then use this Latest Status Date as your chart axis instead of the original Date. Let me know if you need help with the DAX for this. 🙂

Best regards,
Daniel




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Hi @dk_dk 

Thanks for your reply, the half of the issue is solved , i created latest date column and am used a logic to find latest date and am using that in my visual this is working fine but here the issue is i have Client,Employee,Project as slicers 
for example

ProjectDateToClientEmployeeStatusStatusBasedOnMaxDateTimeColumnLatest Date
ProjectA01-10-202408:00:00CEALewisIn ProgressCompleted 
ProjectA05-10-202417:32:00CEALewisCompletedCompleted 
ProjectA15-11-202419:00:00JRVettelIn ProgressCompleted 
ProjectA15-11-202420:00:00JRVettelCompletedCompleted15-11-2024
ProjectB02-10-202406:04:00RACLeclercIn ProgressIn Progress 
ProjectB03-10-202413:31:00RACLeclercCompletedIn Progress 
ProjectB19-10-202401:15:00DOCMaxIn ProgressIn Progress 
ProjectB01-11-202419:00:00DOCMaxIn ProgressIn Progress 


if i select projectA in the slicer its working fine , if i select client JR it will working fine ,but i need to show something like even if we select CEA(client) also i should show as the project is completed ,the count should be in the Nov 2024 like same for Employee slicer

(i.e) under single project we have multiple clients and vice-versa,under single project we have multiple employees also

the ultimate goal is to match the completed  count which present in the table visual should match with the line chart even if we aggreate the count also

Gokul_Saraboji_0-1741851683186.png

 

Ah I see,

So basically you want 15-11-2024 to be the value in the first 3 rows of your sample data as well (in the Latest Date column)?

Could you share the DAX you used for Latest Date?

Best regards,
Daniel




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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.

Top Solution Authors