Forum Discussion
Trouble Duplicating Line Chart From Excel In Power BI
Hello. Relatively new here. I THOUGHT i understood how to create a chart. For some reason, no matter what combination I try, I can't seem to correctly re-create the line chart from Excel in Power BI.
First image is the excel data I am bring in and the line chart I am supposed to duplicate.
The 2nd are the results I am getting back along with the data.
What am i doing wrong? I have tried changing x and y axis data, legend data. It seems like the simplist thing to do but It just doesnt work for me.
For anyone trying to duplicate what I am doining, here is the data.
| Food | Jan '22 | Feb '22 | Mar '22 | Apr '22 | May '22 | Jun '22 | Jul '22 | Aug '22 | Sep '22 | Oct '22 | Nov'22 | Dec'22 | Avg |
| Rice | 474 | 484 | 964 | 810 | 670 | 562 | 458 | 346 | 303 | 333 | 201 | 77 | 474 |
| Beans | 164 | 165 | 303 | 203 | 78 | 148 | 221 | 136 | 122 | 156 | 74 | 20 | 149 |
| Tortillas | 41 | 57 | 182 | 246 | 95 | 181 | 244 | 164 | 87 | 108 | 99 | 40 | 129 |
Unpivotting your table in Power Query is the key step.
Follow these steps:
In Power Query
- select Food column and unpivot other columns
- fix up the period and convert it to a dateCreate and configure Date table.
Line chart with:
- x-axis: MMM-YY
- y-axis: [Sales] measure
- Legend: [Food] columnpbix: https://1drv.ms/u/s!AnF6rI36HAVkhPIi3NykR9olljC9sw?e=n6zGcI
Let me know if this helps.
3 Replies
- Ashish_MathurSuper User
- grantsambornSolution Sage
Unpivotting your table in Power Query is the key step.
Follow these steps:
In Power Query
- select Food column and unpivot other columns
- fix up the period and convert it to a dateCreate and configure Date table.
Line chart with:
- x-axis: MMM-YY
- y-axis: [Sales] measure
- Legend: [Food] columnpbix: https://1drv.ms/u/s!AnF6rI36HAVkhPIi3NykR9olljC9sw?e=n6zGcI
Let me know if this helps.
- kitcatnjFrequent Visitor
AMAZING! I did try to pivot originally, but i did it on all the columns and it didnt do much for me. I didnt know you could keep on column selected and pivot the rest. It worked PEFECTLY!!!! Thank you so so much!