Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Calculate percentage for donut chart

Hi, I feel confuse on how does the donut chart percentage being calculated. I have a situation that I need to display percentage of task completion for each of the project in the donut chart.   Fo...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 

    Thanks for your quick reply, if you want to display '0%', you need to change the  donut chart to table visual, because the donut chart cannot display the value '0' , and change the measure to the following.

    MEASURE =
    VAR a =
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[Linked Issue] ),
            'Table'[Status] = "Closed"
        )
    VAR b =
        CALCULATE (
            COUNTA ( 'Table'[Linked Issue] ),
            ALLSELECTED ( 'Table' ),
            'Table'[Project Name] IN VALUES ( 'Table'[Project Name] )
        )
    RETURN
        IF ( a > 0, DIVIDE ( a, b ), 0 )
    

    Then it can display.

    Best Regards!

    Yolo Zhu

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