Forum Discussion

h11's avatar
h11
Helper III
1 year ago
Solved

Projects Created Vs Projects Completed

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 1...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from Sahir_Maharaj , please allow me to provide another insight:

    Hi, h11 
    Thanks for reaching out to the Microsoft fabric community forum.

    Regarding the issue you raised, my solution is as follows:

    1.First, you need to create a new date table that includes all dates,Please ensure that this calculated table does not establish any relationships with the original data:

    date = 
        CALENDAR(
            MINX(
                {
                    MIN('Table'[Completed Date]),
                    MIN('Table'[Created Date])
                },
                [Value]
            ),
            MAXX(
                {
                    MAX('Table'[Completed Date]),
                    MAX('Table'[Created Date])
                },
                [Value]
            )
        )
    

    2.Secondly, create the following two measures:

    Projects Completed = 
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALL ( 'Table' ),
            MONTH ( 'Table'[Completed Date] ) = MONTH ( MAX ( 'date'[Date] ) )
                && YEAR ( 'Table'[Completed Date] ) = YEAR ( MAX ( 'date'[Date] ) )
        )
    )
    
    Projects Created = 
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALL ( 'Table' ),
            MONTH ( 'Table'[Created Date] ) = MONTH ( MAX ( 'date'[Date] ) )
                && YEAR ( 'Table'[Created Date] ) = YEAR ( MAX ( 'date'[Date] ) )
        )
    )

    3.Next, modify the format of the date: 

    4.Here's my final result, which I hope meets your requirements.

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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