Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am currently building an automation with Power BI from an Excel file like below:
Sales | 2022-2023 | 2023-2024 | 2024-2025 |
Q1 | 63 | 74 | 113 |
Q2 | 14 | 35 | |
Q3 | 24 | 178 | |
Q4 | 100 | 68 |
base on the sales data we could get a cumulative table:
Q2 YTD = Q1 sales+ Q2 sales ... etc.
2022-2023 | 2023-2024 | 2024-2025 | |
Q1 YTD | 63 | 74 | 113 |
Q2 YTD | 77 | 109 | 113 |
Q3 YTD | 101 | 287 | 113 |
Q4 YTD | 201 | 355 | 113 |
Select the table and insert a line chart
I am having issue on rebuilding this into Power BI since a line chart needs a measure for each line, I will have to build a new measure each year which isn't sound like a good plan. Wondering if we have a way to build a line chart ( or other charts if works) from a table instead of a few measures.
The table should be transformed then we will have Quarters as columns and years as rows which are more dynamic, but is it easier to build the lines by measures? by using the transformed table Excel could generate the same chart while I have no idea on how to use a table to feed the Line chart.
Q1 YTD | Q2 YTD | Q3 YTD | Q4 YTD | |
2022-2023 | 63 | 77 | 101 | 201 |
2023-2024 | 74 | 109 | 287 | 355 |
2024-2025 | 113 | 113 | 113 | 113 |
Thank you for reading and any comment is appreciated!
Solved! Go to Solution.
Hello @MiaSunny ,
İf you'd like to use few of measure or none. You can use legend option but your table needs to be fitted for the case. For example for your case you can unpivot the column Q1,YTDQ2,YTDQ3,YTDQ4,YTD in transform data(power query). Lastly, your table needs to be like this:
Year | Att | Val |
2022-2023 | Q1 | 63 |
2022-2023 | YTDQ2 | 77 |
... | ... | ... |
2024-2025 | YTD | 113 |
In the line chart, X-axis will be year, Y-axis will be Val, Legend will be Att.
Kind Regards,
Gökberk Uzuntaş
📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!
🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |
Hi @MiaSunny , You can follow these steps to create the line chart.
Unpivot Data in Power Query
Create Line Chart
Hello @MiaSunny ,
İf you'd like to use few of measure or none. You can use legend option but your table needs to be fitted for the case. For example for your case you can unpivot the column Q1,YTDQ2,YTDQ3,YTDQ4,YTD in transform data(power query). Lastly, your table needs to be like this:
Year | Att | Val |
2022-2023 | Q1 | 63 |
2022-2023 | YTDQ2 | 77 |
... | ... | ... |
2024-2025 | YTD | 113 |
In the line chart, X-axis will be year, Y-axis will be Val, Legend will be Att.
Kind Regards,
Gökberk Uzuntaş
📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!
🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |