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

can't add second value to bar graph

I have a summary chart of various values by fiscal year. It has three values per fiscal year for several constuencies (a base count, a new count, and a percentage calculated from the two).  I'd like to compare the two counts in a bar chart. When I try to drag the second variable to Value, it instead drops it into Tooltips. I cannot get PowerBi to let me drag it into Value. Both variables are whole numbers. What is wrong with my data?

1 ACCEPTED SOLUTION

You need something for your axis. So either your fiscal year as your axis or something else.


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

Couple things to check, make sure your columns are not text for some reason. Are both counts measures or are they columns with a count or sum aggregation? Do you have a field in the Legend already? Sample data would help. I can create a bar chart with a common axis and drag two or even three values into it, in my case 2 columns and a measure. Even if I drag a text column to values it automatically changes to "Count of column". Very odd behavior you are seeing. There's reason but need more info to know what is going on. Even if I have something in the Legend if I drag another column into Value, it replaces the current column there and doesn't move it to Tooltips. What version of Power BI Desktop are you on?

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

Both values are whole numbers. They aren't counts of a larger data set, just a total in a chart with other totals. I can add both values to a blank graph, but then I can't add fiscal year to be the legend. It wants to sum all the numbers.

 

The data looks like this:

                        Prior FY Count    Current FY Count    Pct

2015-2016        840                     585                         69.6%

2016-2017        908                     562                         61.9%

2017-2018        884                     632                         71.5%

2018-2019        947                       33                         3.5%  (this one is FY to date)

You need something for your axis. So either your fiscal year as your axis or something else.


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

Yes, that did it.  I added the fiscal year as the axis first and then it let me add the two variables as values.

rajendran
Super User
Super User

Hi @julied

 

What chart you are using? If you use stacked bar chart, it will allow you to have 2 measures in values section. Try that.

 

Thanks

Raj

julied
Frequent Visitor

Stacked bar won't work with my data. It looks like this:

 

Base Count 101

New Count 59

Percentage 58.4%

 

I want to be able to show base count next to the new count in a clustered bar graph. The users of the data want to see the before and after counts for just one year at a time (previous year and current year). I'll have another graph that compares the percentages for multiple years.

julied
Frequent Visitor

Strangely, I got it to work by first trying it as a combined bar and line graph and then clicking on other charts to see if any of them worked better. After going to the ribbon, I then went back to the bar and line, but it left both variables in Value for the bar chart (with nothing for the line chart). I thought I'd try the combined bar graph again to see if it stuck, and it did. I still don't know why it wouldn't let me add the second variable initially. I'd still like help with that, if possible, in case I need to do this again.

Helpful resources

Announcements
Power BI Show Ep 4 Post Show Carousel.jpg

The Power BI Community Show

Shabnam Watson demos Incremental refresh & Hybrid Tables and Leila Etaati demos Charticulator.

PBI April Release 2022 768x460.png

Check it out!

Click here to read more about the April 2022 updates!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!