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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Rollow
Regular Visitor

Line chart with multiple measures with same dimensions

Goodday,

 

I have a table with 2 dimensions and 2 measures that use the same dimension. 

Rollow_0-1748950389499.png

 

 

I would like to make a line chart from this, with showing all lines. But i seem to be unable to add both measures in the line chart. Why is this and how can i fix this? 

1 ACCEPTED SOLUTION
Elena_Kalina
Solution Supplier
Solution Supplier

Hi @Rollow 

Based on your table, you want to create a line chart showing both Measure 1 and Measure 2 across different dimensions over two years. The issue you're experiencing is likely due to how your data is structured and how your visualization tool handles multiple measures.

Why You Can't Add Both Measures

Most visualization tools expect data in a "tidy" format where:

  • Each variable forms a column

  • Each observation forms a row

  • Each type of observational unit forms a table

Your current table has measures spread across columns, which can make it difficult to plot both measures simultaneously.

How to Fix This

1. Pivot Your Data (Recommended)

  1. Go to "Transform Data" in Power BI

  2. Select your table

  3. Choose both Measure 1 and Measure 2 columns (hold Ctrl)

  4. Click "Unpivot Columns" under the Transform tab

  5. Rename the new columns:

    • "Attribute" → "Measure_Type"

    • "Value" → "Measure_Value"

Year       Dimension  Measure_Type  Value
2023-2024  DH         Measure 1     2.6
2023-2024  DH         Measure 2     2.86
2023-2024  GEM        Measure 1     2.5
2023-2024  GEM        Measure 2     2.85
... (and so on for all rows)

In this format, you can:

  1. Put Year on the X-axis

  2. Put Value on the Y-axis

  3. Use Dimension for color encoding (lines)

  4. Use Measure_Type to create separate lines for each measure

Step 2: Create the Line Chart

  1. Select the Line Chart visualization

  2. Configure fields:

    • X-axis: Year

    • Y-axis: Measure_Value

    • Legend: Measure_Type (to show both measures)

    • Details: Dimension (to separate lines by DH, GEM, etc.)

Alternative Solution: Combo Chart

If you prefer not to transform data:

  1. Select the "Line and Column Chart" visualization

  2. Configure:

    • Shared X-axis: Year

    • Column Y-axis: Measure 1

    • Line Y-axis: Measure 2

    • Legend: Dimension

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!  Thank you.

View solution in original post

2 REPLIES 2
Elena_Kalina
Solution Supplier
Solution Supplier

Hi @Rollow 

Based on your table, you want to create a line chart showing both Measure 1 and Measure 2 across different dimensions over two years. The issue you're experiencing is likely due to how your data is structured and how your visualization tool handles multiple measures.

Why You Can't Add Both Measures

Most visualization tools expect data in a "tidy" format where:

  • Each variable forms a column

  • Each observation forms a row

  • Each type of observational unit forms a table

Your current table has measures spread across columns, which can make it difficult to plot both measures simultaneously.

How to Fix This

1. Pivot Your Data (Recommended)

  1. Go to "Transform Data" in Power BI

  2. Select your table

  3. Choose both Measure 1 and Measure 2 columns (hold Ctrl)

  4. Click "Unpivot Columns" under the Transform tab

  5. Rename the new columns:

    • "Attribute" → "Measure_Type"

    • "Value" → "Measure_Value"

Year       Dimension  Measure_Type  Value
2023-2024  DH         Measure 1     2.6
2023-2024  DH         Measure 2     2.86
2023-2024  GEM        Measure 1     2.5
2023-2024  GEM        Measure 2     2.85
... (and so on for all rows)

In this format, you can:

  1. Put Year on the X-axis

  2. Put Value on the Y-axis

  3. Use Dimension for color encoding (lines)

  4. Use Measure_Type to create separate lines for each measure

Step 2: Create the Line Chart

  1. Select the Line Chart visualization

  2. Configure fields:

    • X-axis: Year

    • Y-axis: Measure_Value

    • Legend: Measure_Type (to show both measures)

    • Details: Dimension (to separate lines by DH, GEM, etc.)

Alternative Solution: Combo Chart

If you prefer not to transform data:

  1. Select the "Line and Column Chart" visualization

  2. Configure:

    • Shared X-axis: Year

    • Column Y-axis: Measure 1

    • Line Y-axis: Measure 2

    • Legend: Dimension

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!  Thank you.

ajaybabuinturi
Solution Supplier
Solution Supplier

Hi @Rollow ,
Could you please provide the sample .pbix file. 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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