Forum Discussion

MiaSunny's avatar
MiaSunny
Icon for Helper I rankHelper I
1 year ago
Solved

How to build a line chart with multiple lines from dynamic table/ measures

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 ...
  • uzuntasgokberk's avatar
    1 year ago

    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 |