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
OrM
Frequent Visitor

Several Horizontal Bar chart split by % of column values

Hi everyone,

 

I am trying to put some data on the horizonta bar chart.

Here is the table I have:

EmployeeQuestion 1Question 2Question 3
Employee 1YesNoNo
Employee 2NoYesNo
Employee 3Yes Yes
Employee 4YesNoNo
Employee 5NoYesNo
Employee 6  Yes
Employee 7YesNo 
Employee 8Yes No
Employee 9 No 
Employee 10 No 

 

I want to get a visual which will show 3 bar charts with % of Yes, No and Blank values as below:

OrM_0-1619702407052.png

 

One stacked ar chart for some reason the categories (Yes, No, Blank) are getting split to separated bars instead of showing % on one bar. 

 

Thank you!

 

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @OrM ,

 

Refer the formula to create a new table.

Table 2 = UNION(SELECTCOLUMNS('Table',"employee",'Table'[Employee],"question","question1","status",IF('Table'[Question 1] in {"Yes","No"},'Table'[Question 1],"Blank")),
                SELECTCOLUMNS('Table',"employee",'Table'[Employee],"question","question2","status",IF('Table'[Question 2] in {"Yes","No"},'Table'[Question 2],"Blank")),
                SELECTCOLUMNS('Table',"employee",'Table'[Employee],"question","question3","status",IF('Table'[Question 3] in {"Yes","No"},'Table'[Question 3],"Blank")))

Then put question in Axis, status in Legebd and count of employee in Values.

Capture.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @OrM ,

 

Refer the formula to create a new table.

Table 2 = UNION(SELECTCOLUMNS('Table',"employee",'Table'[Employee],"question","question1","status",IF('Table'[Question 1] in {"Yes","No"},'Table'[Question 1],"Blank")),
                SELECTCOLUMNS('Table',"employee",'Table'[Employee],"question","question2","status",IF('Table'[Question 2] in {"Yes","No"},'Table'[Question 2],"Blank")),
                SELECTCOLUMNS('Table',"employee",'Table'[Employee],"question","question3","status",IF('Table'[Question 3] in {"Yes","No"},'Table'[Question 3],"Blank")))

Then put question in Axis, status in Legebd and count of employee in Values.

Capture.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@OrM , replace blank with value blank in power query. blank as text blank

https://youtu.be/hkZhZbR7Kmk

 

the unpivot the Questions, you will question column

 

Now create a stacked visual Question on axis, Answer(yes, no and blank) on legend, employee count as value 

 

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.