Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

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.

1.png

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. 

View solution in original post

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

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.

1.png

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. 

ryan_mayu
Super User
Super User

@Anonymous 

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

1.png

2. create a measure

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

2.PNG

below is the pbix file for your reference





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan,

 

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

@Anonymous 

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

1.png

updated the attachment as well.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.