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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tandtkg
Frequent Visitor

How to display 2 Values (2 Ys) based on 2 Axis (2 Xs) in a line chart?

Let's say I have 2 tables:

T1:

X1 Y1

1   2

2   3

3   4

 

T2:

X2 Y2

1.1  4

2.3  2

3.1 4

 

Is it possible to display 2 line charts on the same plot like this: https://imgur.com/a/jRbnotR

I know it's possible if X1 is the same as X2 (both have same x values) but in this case X1 is different than X2

I tried different things couldn't seem to make it work.

Thanks!

3 REPLIES 3
sturlaws
Resident Rockstar
Resident Rockstar

Hi @tandtkg ,

 

In Power BI you have to create a common x-axis for the two tables. For you sample data you can append and merge X1 and X2 into a new table, and join both T1 and T2 to this new table. 

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Hello, I tried but it still didn't work

So I merge 2 tables into a new table:

T_main

X      Y

1       2

1.1    4

2       3

2.3     2

3       4

3.1     4

 

And I joined T1 to T_main and T2 to T_main (in manage relationship)

Then I use line chart, I drag X to Axis and both Y1 and Y2 to values but the line didn't appear properly

 

Could you please try it if it's possible? I'd appreciate it.

Thanks

 

example 

 

make sure the merged column is formatted as decimal number in power query

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors