Forum Discussion

jen8080's avatar
jen8080
Helper I
5 years ago

Clustered column chart adding percent line

Hello-

 

I need to add a measure to this data to calculate the % on time and then add that to a line in my clusered column chart.

The 'on time' and 'missed' categories are a new column that I created based on the data.

I am having trouble coming up with the measure to get this. Any help is appreciated. 

 

 

 

 

5 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    jen8080 

     

    Try:
    % On time = 
    VAR TotalProjects = CALCULATE([Count of Project], ALL(Table[Category]))
    VAR OnTime = CALCULATE([Count of Project], Table[Category] = "On Time")
    RETURN
    DIVIDE(OnTime, TotalProjects)

  • v-alq-msft's avatar
    v-alq-msft
    Community Support

    Hi, jen8080 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may create a measure as below.

    Result = 
    COALESCE( 
        DIVIDE(
            COUNTROWS(
                FILTER(
                    'Table',
                    [On Time*]="On Time"
                )
            ),
            COUNTROWS(
                'Table'
            ),
            0
        ),
        0
    )

     

    Then you can set 'Show secondary' on.

     

    Result:

     

    Best Regards

    Allan

     

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

    • jen8080's avatar
      jen8080
      Helper I

      Hi v-alq-msft,

       

      I think this is close I have one more value though in my table 'missing complete date' where I don't yet have dates for the project. Is this easy to factor into your calculation?

      I just chose to not show these on the graph but when entering your formula an error comes up.

       

      Thanks!

       

      • v-alq-msft's avatar
        v-alq-msft
        Community Support

        Hi, jen8080 

         

        Could you please show us some sample data and expected result with OneDrive for business? Do mask sensitive data before uploading. Thanks.

         

        Best Regards

        Allan