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

Create a Stacked Column Chart Help

Hey all,

 

Forgive this messy question, I'm not sure how to word it, or provide very good examples of what I'm trying to create.

 

My data sheet includes year, state, and strain (among several other pieces of information, with irrelevant stuff removed/filtered out)

Stacked column help.jpg

 

 

I would like to create a stacked column chart. I want "State" to be on the X axis, and the column to be comprised of the different strains. So if Delaware had (these are random numbers that don't match the pictures) 7 occourances of strain 1, 4 occurances of strain 2, and 1 occurance of strain 3, i want that to tranlate into 100% of Delaware's samples. 

 

I was pretty close to having what I needed, but it wasn't quite right, and now I'm stuck again.

 

I've attached a paint picture of what I'm trying to accomplish.


Stacked Bar Help.jpg

I've looked at some previously answered questions similar to mine, and one of them said something about unpivoting my data...but it was never pivoted to begin with? And I don't fully understand what pivoting/unpivoting even does.

 

ETA: I want the chart to be able to "count" the occurances of each strain by the state. I have measurements up the wazoo, but can't efficiently create the visual I want.

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @CosmicHorse95 

 

Can you try the following:

 

1. Create a new measure (Measure = COUNTROWS (TableName)

2. Drag the visual on to your Power BI Canvas.

3. Place "State" on x-axis

4. Please Strain in Legend

5. Drag Measure into Values.

 

Should give you what you want.

 

Hope it helps.

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

3 REPLIES 3
CosmicHorse95
Frequent Visitor

Thank you @TheoC !!!

 

Absolute pleasure @CosmicHorse95 

 

Have a great day!

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Super User
Super User

Hi @CosmicHorse95 

 

Can you try the following:

 

1. Create a new measure (Measure = COUNTROWS (TableName)

2. Drag the visual on to your Power BI Canvas.

3. Place "State" on x-axis

4. Please Strain in Legend

5. Drag Measure into Values.

 

Should give you what you want.

 

Hope it helps.

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors