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

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:

Data SetData Set

 

Excel:

Excel OriginalExcel Original

 

Power BI:

Power BIPower BI

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

hi @Anonymous 

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
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

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.
VasTg
Memorable Member
Memorable Member

@Anonymous 

 

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.

Connect on LinkedIn
Anonymous
Not applicable

@VasTg 

 

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

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.