Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Arranging Data for an Bar Chart

Hi All,

 

I need to arrange the below data so that I get a Bar Chart that has the X-Axis as each 'Task' and then on the Y-Axis a % Completion. 

 

If anyone could help I would greatly appreciate it.

 

The dataset is below, if you could provide an example of how you would arrange it so I can achieve the above, that would be great:

 

 

Part NumberDescriptionTask 1Task 2Task 3Task 4Task 5
1ACompleteCompleteCompleteCompleteIn-Progress
2BCompleteCompleteCompleteCompleteIn-Progress
3CCompleteCompleteCompleteCompleteIncomplete
4DCompleteCompleteCompleteCompleteIncomplete
5ECompleteCompleteCompleteCompleteIncomplete
6FCompleteCompleteCompleteIncompleteIncomplete
7GCompleteCompleteCompleteCompleteIncomplete
8HCompleteCompleteCompleteIncompleteIncomplete
9ICompleteCompleteCompleteIncompleteIn-Progress
10JCompleteCompleteCompleteCompleteIncomplete
11KCompleteCompleteCompleteCompleteIncomplete
12LCompleteCompleteCompleteCompleteIncomplete
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

    In addition to  's reply, after unpivote the Task columns , you can build a 100% stacked column chart directly.

    Add Attribute(Task Name) in X axis, Value(Status) in Legend, and add Value(Status) in Values(use count funtction in this visual)

    Result is as below.

    You can download the pbix file from this link: Arranging Data for an Bar Chart

     

    Best Regards,

    Rico Zhou

     

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

4 Replies

  • Anonymous 

    1. select partnumber and description columns and unpivot other columns in the PQ

    2. create a measure

    complete% = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Value]="Complete"))/COUNTROWS('Table')

    below is the pbix file for your reference

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ryan,

       

      Appreciate your help, however I'd ideally want the X-Axis to have to various tasks. Is this possible?

      • ryan_mayu's avatar
        ryan_mayu
        Icon for Super User rankSuper User

        Anonymous 

        you can put values(new name of task after unpivot columns) in the X-ais

        updated the attachment as well.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    In addition to  's reply, after unpivote the Task columns , you can build a 100% stacked column chart directly.

    Add Attribute(Task Name) in X axis, Value(Status) in Legend, and add Value(Status) in Values(use count funtction in this visual)

    Result is as below.

    You can download the pbix file from this link: Arranging Data for an Bar Chart

     

    Best Regards,

    Rico Zhou

     

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