cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nlprin Frequent Visitor
Frequent Visitor

Stacked Column Chart - swap x-axis and y-axis

I am trying to recreate a chart from Excel into Power BI, but I am having trouble getting the x-axis and y-axis to be the same as my original chart. The location should be stacked and months run along the x-axis. Anyone no if this is possible?

 

Data set:

Capture3.GIFData Set

 

Excel:

Capture1.GIFExcel Original

 

Power BI:

Capture2.GIFPower BI

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Stacked Column Chart - swap x-axis and y-axis

hi @nlprin 

From your screenshot, we could know that your data structure is this:

3.JPG

So you need to transform your data structure as below:

Step1:

In edit queries, Selected Dec-Total,Jan-Total,Feb-Total... 

Then click Unpivot columns

https://radacad.com/pivot-and-unpivot-with-power-bi

4.JPG

Step2:

Now create visual, drag Attribute column in X-Axis, Location into Lenged and Value into Value

5.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

3 REPLIES 3
VasTg Established Member
Established Member

Re: Stacked Column Chart - swap x-axis and y-axis

@nlprin 

 

You should move "location" to legend, "month" column(if any - if not create one) to Axis and the single "total" column to Value.

 

If it helps, mark it as a solution.

Kudos are nice too.

nlprin Frequent Visitor
Frequent Visitor

Re: Stacked Column Chart - swap x-axis and y-axis

@VasTg 

 

Not sure if I'm following. My month values are already in the value input which is a column.  

Community Support Team
Community Support Team

Re: Stacked Column Chart - swap x-axis and y-axis

hi @nlprin 

From your screenshot, we could know that your data structure is this:

3.JPG

So you need to transform your data structure as below:

Step1:

In edit queries, Selected Dec-Total,Jan-Total,Feb-Total... 

Then click Unpivot columns

https://radacad.com/pivot-and-unpivot-with-power-bi

4.JPG

Step2:

Now create visual, drag Attribute column in X-Axis, Location into Lenged and Value into Value

5.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)