Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
EllieRen
New Member

Line Graph with line for each week

Hi, 

I am trying to create a line graph to show exactly as this picture from excel. I can't seem to get the data to display this way in Power Bi. I have tried numerous tweaks and nothing will display my graph so that each line represents the week's worth of results. Excel does this straight away so I'm not sure why PBI won't do the same?  Thank you Screenshot 2024-04-02 144542.png

1 ACCEPTED SOLUTION
RossEdwards
Solution Sage
Solution Sage

This graph will be made up of 3 different data points: X-Axis, Y-Axis and Legend.

 

Based on what i see:

X-Axis is your Column names

Y-Axis is your Sum of Values

Legend is your Dates.

 

You immediate problem will be the column names.  So my suggestion will be to go into Transform Data and do an Unpivot of your data.  This should give you an 'Attribute' column which contains the column heading names, and then 2nd column which holds your values.  Now you should be able to get that X-Axis working.

View solution in original post

3 REPLIES 3
RossEdwards
Solution Sage
Solution Sage

This graph will be made up of 3 different data points: X-Axis, Y-Axis and Legend.

 

Based on what i see:

X-Axis is your Column names

Y-Axis is your Sum of Values

Legend is your Dates.

 

You immediate problem will be the column names.  So my suggestion will be to go into Transform Data and do an Unpivot of your data.  This should give you an 'Attribute' column which contains the column heading names, and then 2nd column which holds your values.  Now you should be able to get that X-Axis working.

Thank you so much, this has worked nicely to achieve what I was after. 

Khushidesai0109
Super User
Super User

@EllieRen 

It sounds like you're encountering some difficulty replicating the exact graph layout from Excel in Power BI. Let me guide you through how you can potentially achieve this in Power BI:

  1. Data Structure: Ensure your data is structured properly. You should have columns for the date, the category (in your case, "Week"), and the values you want to plot.

  2. Data Model: Import your data into Power BI and create a proper data model. Make sure that your date column is recognized as a date data type.

  3. Create a Line Chart: Drag the "Week" column into the Axis field well and the value you want to plot into the Values field well. This should automatically generate a line chart.

  4. Adjust Axis: If your "Week" column is not being recognized as a time series, you may need to adjust the axis type to be a continuous (date) axis rather than a categorical axis. You can do this by selecting the axis and then going to the Format pane to change the axis type.

  5. Data Grouping: If your data isn't already grouped by week, you may need to create a new calculated column to group your data by week. You can use DAX functions like WEEKNUM() and YEAR() to achieve this.

  6. Line Styles and Colors: You can adjust the line styles and colors in the formatting options to match the appearance you want.

If you're still having trouble replicating the exact graph from Excel, it might be helpful to provide more specific details about your data structure and the issues you're encountering in Power BI.


Please give Thumbs up or Accept this solution if it helped you out

Proud to be a Super User!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors