Forum Discussion

h11's avatar
h11
Helper III
1 year ago
Solved

Line Graph for projects

Hello All,

 

My team has requested a line chart comparing "Project Completed per Month" vs "Projects Created per Month." I have data for approximately 250 projects and have attached a sample with 10 projects for reference. Could you please provide the formula to create a line graph where the X-axis represents months, and the Y-axis has two lines: one for the count of "Projects Completed per month" and the other for the count of "Projects Created per month"?

 

I request to attach the Power BI file if possible that you worked on using my data as a reference. Thank you in advance.

 

Project NameCreated DateCompleted Date
A10/18/202412/2/2024
B10/3/202410/30/2024
C10/3/202411/25/2024
D8/20/202412/31/2024
E1/3/2025 
F11/4/20241/17/2025
G9/13/202412/23/2024
H1/15/2025 
I10/25/20241/11/2025
J1/22/2025 
J10/12/2024 
  • hello h11 

     

    i might be misunderstood but do you have 25 more columns of date similar to 'Completed Date' and 'Created Date'?

     

    also how do you get your data? if it is imported, you should have access to Power Query of your data? unless you get the data by Direct Query.

     

    otherwise, please check this pbix if this suite to your requirement.

    this is made without unpivot however the date table connected to 'Created Date' since looks like it will have value unlike 'Completed Date' which has blank value.

     

    Thank you.

3 Replies

  • Irwan's avatar
    Irwan
    Super User

    hello h11 

     

    please check if this accomodate your need.

    1. unpivot your table

     

    2. create two measures for completed and created

    Completed = 
    CALCULATE(
        COUNT('Table'[Attribute]),
        'Table'[Attribute]="Completed Date"
    )
    Created = 
    CALCULATE(
        COUNT('Table'[Attribute]),
        'Table'[Attribute]="Created Date"
    )

     

    Hope this will help.

    Thank you.

    • h11's avatar
      h11
      Helper III

      Irwan Hi Irwan,

       

      Thank you so much for trying to help me. Unfortunately, I cannot use this approach as I have more than 25 columns in my table and I can't unpivot my table by using the attribute and value in the table. Please help me with an alternate approach.

      • Irwan's avatar
        Irwan
        Super User

        hello h11 

         

        i might be misunderstood but do you have 25 more columns of date similar to 'Completed Date' and 'Created Date'?

         

        also how do you get your data? if it is imported, you should have access to Power Query of your data? unless you get the data by Direct Query.

         

        otherwise, please check this pbix if this suite to your requirement.

        this is made without unpivot however the date table connected to 'Created Date' since looks like it will have value unlike 'Completed Date' which has blank value.

         

        Thank you.