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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.