Forum Discussion
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 Number | Description | Task 1 | Task 2 | Task 3 | Task 4 | Task 5 |
| 1 | A | Complete | Complete | Complete | Complete | In-Progress |
| 2 | B | Complete | Complete | Complete | Complete | In-Progress |
| 3 | C | Complete | Complete | Complete | Complete | Incomplete |
| 4 | D | Complete | Complete | Complete | Complete | Incomplete |
| 5 | E | Complete | Complete | Complete | Complete | Incomplete |
| 6 | F | Complete | Complete | Complete | Incomplete | Incomplete |
| 7 | G | Complete | Complete | Complete | Complete | Incomplete |
| 8 | H | Complete | Complete | Complete | Incomplete | Incomplete |
| 9 | I | Complete | Complete | Complete | Incomplete | In-Progress |
| 10 | J | Complete | Complete | Complete | Complete | Incomplete |
| 11 | K | Complete | Complete | Complete | Complete | Incomplete |
| 12 | L | Complete | Complete | Complete | Complete | Incomplete |
- Anonymous5 years ago
Hi Anonymous
In addition to ryan_mayu '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
- ryan_mayu
Super User
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
- AnonymousNot applicable
Hi Ryan,
Appreciate your help, however I'd ideally want the X-Axis to have to various tasks. Is this possible?
- ryan_mayu
Super User
Anonymous
you can put values(new name of task after unpivot columns) in the X-ais
updated the attachment as well.
- AnonymousNot applicable
Hi Anonymous
In addition to ryan_mayu '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.