Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Good day,
I have 2 independant graphs associated to 2 independant table.
table1 with x1-values y1-values and table2 with x2-values y2-values
All data are decimals, BUT x1-values do not match x2-values
Is is possible to have the two curve on the same graph ?
I guess it should be easy but i am struggling
Thank you so much.
Solved! Go to Solution.
Hi @NicoBoss
Thank you very much govind_021 for your prompt reply.
If Time1 is not equal to Time2, I suggest you create a bridge table as follows:
“Time1”
"Time2"
Create a new table.
Bridge Table =
UNION(
SELECTCOLUMNS(
'Table1',
"Time",
'Table1'[Time1]),
SELECTCOLUMNS(
'Table2',
"Time",
'Table2'[Time2])
)
Table1 and Table2 create relationships with the bridge table respectively.
Create a Python visual.
import matplotlib.pyplot as plt
# Create figure and axis
ax = plt.gca()
dataset.plot(kind= "line", x='Time1', y='Depth1', color= "Red", ax= ax)
dataset.plot(kind= "line", x='Time2', y='Depth2', color= "Blue", ax= ax)
# Show plot
plt.show()
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NicoBoss
Can you give more context to your question by adding images of the problem , if confidential then with dummy data.
Thanks Sure, I tried the code below.
This code is working fine if Time1=Time2, then i can create a table with 3 column only, X=Time1 Y1=Depth1 and Y2=Depth2 and plot 2 curves.
But Time1≠Time2, also the table1 is not the same size as table2, so I cannot merge and I get the error : "can't display the data because PowerBI can't determine the relationship between two or more fields"
Indeed they are 2 different tables from 2 different queries.
Time1/Depth1 and Time2/Depth2 are from 2 different datatables in the same powerbi, I opened a Py-Python Visual, draged and droped those tables in the "Values" field.
Basically just want to overlay 2 curves (without the same dimension), should be easy? I am struggling for more than 1 day... I read it is not so easy in PowerBI DAX but they are ways around, but so far still searching...
---
Hi @NicoBoss
Thank you very much govind_021 for your prompt reply.
If Time1 is not equal to Time2, I suggest you create a bridge table as follows:
“Time1”
"Time2"
Create a new table.
Bridge Table =
UNION(
SELECTCOLUMNS(
'Table1',
"Time",
'Table1'[Time1]),
SELECTCOLUMNS(
'Table2',
"Time",
'Table2'[Time2])
)
Table1 and Table2 create relationships with the bridge table respectively.
Create a Python visual.
import matplotlib.pyplot as plt
# Create figure and axis
ax = plt.gca()
dataset.plot(kind= "line", x='Time1', y='Depth1', color= "Red", ax= ax)
dataset.plot(kind= "line", x='Time2', y='Depth2', color= "Blue", ax= ax)
# Show plot
plt.show()
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |