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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lia_viegas
Regular Visitor

Creating a chart using the same legend to different columns

Hello!

 

I've just started to use Power BI to create dashboards and I have a big issue to solve. My table is like this:

 

 

 

IDQ1Q2
1YesYes
2YesYes
3YesNo
4NoYes
5NoYes
5NoNo
6YesYes
7NoYes
8YesNo
9NoYes
10NoNo

 

 

 And I want to create a barchart where I use Yes/No as my legend and bars are grouped by my table's columns, as in this image:

 

 

tste.png

 

A partner told me that the only way I could do it was by creating a new table like this one:

 

IDQ1Q2
1YesQ1
2YesQ1
3YesQ1
4NoQ1
5NoQ1
5NoQ1
6YesQ1
7NoQ1
8YesQ1
9NoQ1
10NoQ1
1YesQ2
2YesQ2
3YesQ2
4NoQ2
5NoQ2
5NoQ2
6YesQ2
7NoQ2
8YesQ2
9NoQ2
10NoQ2

 

 

But I trully believe there is another solution and we are not figuring it out.

 

Could you help me with this issue?

 

Big thanks!

 

 

 

 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@lia_viegas

Look at ALL my responses in this post (you will have to unpivot)

http://community.powerbi.com/t5/Desktop/Multiple-Stacked-Bar-Charts/m-p/111938#M47176

 

EDIT:

Its really very easy - click Edit Queries

In the Query Editor => select the ID Column => Transform tab  => Unpivot Columns => Unpivot Other Columns

Now double click on the new column names and rename each => then Home tab => Close & Apply

build your chart!

 

That's it!

Good Luck! Smiley Happy

 

Unpivot Other Columns.png

 

View solution in original post

4 REPLIES 4
Sean
Community Champion
Community Champion

@lia_viegas

Look at ALL my responses in this post (you will have to unpivot)

http://community.powerbi.com/t5/Desktop/Multiple-Stacked-Bar-Charts/m-p/111938#M47176

 

EDIT:

Its really very easy - click Edit Queries

In the Query Editor => select the ID Column => Transform tab  => Unpivot Columns => Unpivot Other Columns

Now double click on the new column names and rename each => then Home tab => Close & Apply

build your chart!

 

That's it!

Good Luck! Smiley Happy

 

Unpivot Other Columns.png

 

Hello, Sean,

 

Thanks for your answer and sorry for my late reply.

 

So the only thing I can do is what you suggested? What will happen if in the case I must update the data table every week?  My table is kind of big (2000 lines/month, 30 columns), so after unpivoting columns I'll have 60000 lines, will it be a problem?

 

Thanks again!

Hi @lia_viegas,

 

I agree with Sean that the Unpivot option may be the best choice in this scenario. And I don't think 60000 lines could be a problem. It's worth a try.Smiley Happy

 

Regards

Ok!

 

Let's try 8D

 

thanks a lot!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.