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
SillyJam123
Frequent Visitor

Measures in X-axis of bar chart

I have data with all measures like below, how can I create a simple bar chart with column1, column2, column3 is X-axis and the sum of the values in Y-axis

 

column1coulm2column3
117
228
339
444
505

 

 Another chart needed is stacked bar chart (X-axis of Sold and Remaining Capacity reflecting Total Capacity. 

 

Resource Pool ManagerTotal Capacity current calendar month Sold current calendar month Remaining  current calendar month Total Capacity current calendar month +1Sold current calendar month + 1Remaining Capacity current calendar month + 1
Product 110042581103575
Product 210042581103575
Product 310042581103575
Product 42001425821013575
Product 52001425821013575
Product 62001425821013575
Product 73002425831023575
Product 83002425831023575
Product 93002425831023575
Product 104003425841033575
Product 114003425841033575
Product 124003425841033575
Product 134003425841033575
Product 145004425851043575
Product 155004425851043575
Product 165004425851043575
Product 175004425851043575
Product 186005425861053575
Product 196005425861053575
14 REPLIES 14
Anonymous
Not applicable

Hi @SillyJam123

 

A question for clarification: What does one row represents?

Hi @Anonymous, please see the updated table. Hope this helps.

 

 MayJuneJuly
Product A Sold117
Product B Sold228
Product C Sold339
Product D Sold444
Product E Sold505


@SillyJam123 wrote:

Hi @Anonymous, please see the updated table. Hope this helps.

 

  May June July
Product A Sold 1 1 7
Product B Sold 2 2 8
Product C Sold 3 3 9
Product D Sold 4 4 4
Product E Sold 5 0 5

@SillyJam123

You may unpivot the data at first.

Capture.PNG

 

Then get a table as below

Capture333.PNG

 

After that it would be easy to create a visual as below.

 

Capture2.PNG

Thank you @Eric_Zhang

 

I am able to achive the first chart is as you and @Anonymous shared using unpivot. I got [Sold current month] & [Sold current month +1] in X-axis.

 

I am updating original post as well.

 

 

 

 

@Anonymous @Eric_Zhang I am trying to transform data in below format for the "second chart", but not able to attain this in power bi

 

Resource Pool ManagerTotal Capacity current calendar month Attribute Current MonthValue Current MonthTotal Capacity current calendar month +1Attribute Current Month+1Value Current Month+1
Product 1100Sold current calendar month 42110Sold current calendar month + 135
Product 10Remaining  current calendar month 580Remaining Capacity current calendar month + 175
Product 2100Sold current calendar month 42110Sold current calendar month + 135
Product 20Remaining  current calendar month 580Remaining Capacity current calendar month + 175
Anonymous
Not applicable

@SillyJam123

 

Did you ever get your problem solved?

@Anonymous Yes I could achieve it by breaking the table into two, one for sold data and other with remaining data. Then unpivot both separately, union the unpivot tables.

Anonymous
Not applicable

@SillyJam123

 

Awesome, I'm glad about that. Can you accept a solution then, so it can benefit others?

Anonymous
Not applicable

@Eric_Zhang

 

@SillyJam123 and I have corresponded by e-mail. though a good solution, this is not exactly the end goal. I'm not sure if I'm allowed to share a pitcure of the end goal. But basically it is to have one bar for sold current month and one for sold current month +1. Then also have a stacked bar chart, with one color for sold and different color for remaining. It isn't clear from the post itself, and you would probably need the data to realize this as well. I'm writing with @SillyJam123 by e-mail at the moment to figure out what the we have to do to accommodate the end goal.

 

 

Anonymous
Not applicable

hi @SillyJam123

 

Thank you for the reply. I might have a solution, but I need to know more.

 

Could you possibly share the report or data with me?

 

Thank you @Anonymous. I will not be able to share the actual data, but it basically Products solds every month. The expected report is a bar chart showing Months in X-axis and sum of values in Y-axis. Products are not required to be shown in the chart.

Anonymous
Not applicable

@SillyJam123 I understand. My solution depends on how the data is stored. Could you provide an example of it then?

 

If the data is stored like this, with these columns: [Date], [Product], [Value], you can just plot it into a bar chart, where you have date on the x-axis, value on y-axis and product in the legend.

 

If your data is stored differently, please let me know. The goal would then be to make sure it's stored this way. Or go in a different direction.

 

Best

Martin

 

That's correct. Data is stored the way I have mentioned. But when I use Column chart, I dont get separate bars. May I have your email address I can send you the chart I am getting v/s what is expected

Anonymous
Not applicable

Absolutly, my e-mail is: martin@valubi.dk. I think I know how to solve your challenge. I will be awaiting your e-mail.

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.