0
votes
Range   20-04-2020  21-04-2020
0-10    10          14
11-20   23          56
21-30   35          9

I have this table for which I want a stacked graph like this (see image): -

See image here

As you see I can draw this graph in excel as a 'recommended graph', but cant do it in power bi. Using Stacked bar chart template only shows one stacked column and there is no way I found to plot dates on X-axis.

Look here for more : https://www.edureka.co/community/73585/stacked-chart-with-dates-on-x-axis

Please help.
Update: the problem I'm facing with my table: see image here

1

1 Answers

3
votes

This should be fairly simple:

I created a table with 3 columns and 6 rows to present your data.

(Range | Date | Value)

If you have a different data structure where you have the date as columns, you have to unpivot your data first. However, having this as your base, is not be logic because each new data would create a new column..

Steps to take:

  1. Use the stacked column chart.
  2. Ensure your date field is of time date (it has the calendar icon in front if it. Be sure you do NOT use the date hierarchy, click on the date in the Axis field and select the date
  3. Your value field should be a number so it can be summed together.
  4. As Axis, you use the date
  5. As legend you use your range
  6. as value, use the values

end result:

enter image description here

if you also want the number is, set the Data Labels to "On"

enter image description here