Forum Discussion
Line Graph using both axis of table
Hi All, I have the following table where the 1st row gives the months. I am able to make a chart from this in Excel (shown below), but I am unaware of a method in Power BI. Any help is welcome. Thanks.
| Year | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 2016 | -3.23 | -2.45 | -3.67 | -3.43 | -2.76 | -2.39 | -3.22 | -2.27 | -0.04 | -6.19 | -1.94 | -7.90 |
| 2017 | -6.55 | -6.15 | -9.40 | -13.07 | -8.34 | 0.89 | 0.96 | -0.46 | -0.47 | 0.97 | -0.94 | -2.02 |
| 2018 | -2.54 | -1.02 | -0.23 | 2.44 | 1.70 | 12.52 | 4.13 | 3.09 | 1.48 | -0.79 | -3.55 | -5.20 |
| 2019 | -4.08 | -4.96 | -2.54 | -3.01 | -3.54 | -1.88 | -2.68 | -1.45 | -1.81 | -1.27 | -0.95 | 0.06 |
Just unpivot the data in query editor. Right click on first column and choose Unpivot Other Columns, make the Attribute and Value columns numeric types (if needed), and load the table. Then make a line chart and use Year as the legend to get the chart below.
Regards,
Pat
2 Replies
- mahoneypatMicrosoft Employee
Just unpivot the data in query editor. Right click on first column and choose Unpivot Other Columns, make the Attribute and Value columns numeric types (if needed), and load the table. Then make a line chart and use Year as the legend to get the chart below.
Regards,
Pat
- FowmySuper User
Anonymous
First, you need to unpivot the data, then you can create the chart as you need.
Please refer this video: https://www.youtube.com/watch?v=Vff2kRBM95o&t________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂