<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Overlaying graphs with independant tables using python or ... in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4366042#M173358</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912323" data-lia-user-login="NicoBoss" class="lia-mention lia-mention-user"&gt;NicoBoss&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much govind_021&amp;nbsp;for your prompt reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If Time1 is not equal to Time2, I suggest you create a bridge table as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“Time1”&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Time2"&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Bridge Table = 
UNION(
    SELECTCOLUMNS(
        'Table1',
        "Time",
        'Table1'[Time1]),
        SELECTCOLUMNS(
        'Table2',
        "Time",
        'Table2'[Time2])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table1 and Table2 create relationships with the bridge table respectively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a Python visual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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()
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2025 01:57:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-16T01:57:28Z</dc:date>
    <item>
      <title>Overlaying graphs with independant tables using python or ...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4362891#M173212</link>
      <description>&lt;P&gt;Good day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 independant graphs associated to 2 independant table.&lt;/P&gt;&lt;P&gt;table1 with&amp;nbsp;x1-values y1-values and table2 with&amp;nbsp;x2-values y2-values&amp;nbsp;&lt;/P&gt;&lt;P&gt;All data are decimals, BUT &lt;STRONG&gt;x1-values do not match x2-values&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is is possible to have the two curve on the same graph ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess it should be easy but i am struggling&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:26:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4362891#M173212</guid>
      <dc:creator>NicoBoss</dc:creator>
      <dc:date>2025-01-14T08:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying graphs with independant tables using python or ...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4363032#M173216</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912323" data-lia-user-login="NicoBoss" class="lia-mention lia-mention-user"&gt;NicoBoss&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Can you give more context to your question by adding images of the problem , if confidential then with dummy data.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 09:39:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4363032#M173216</guid>
      <dc:creator>govind_021</dc:creator>
      <dc:date>2025-01-14T09:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying graphs with independant tables using python or ...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4363118#M173225</link>
      <description>&lt;P&gt;Thanks Sure,&amp;nbsp; I tried the code below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is working fine if Time1=Time2, then i can create a table with 3 column only, X=Time1 Y1=Depth1 and&amp;nbsp;Y2=Depth2 and plot 2 curves.&lt;/P&gt;&lt;P&gt;But Time1≠Time2, also the table1 is not the same size as table2, so I cannot merge and I get the error : &lt;EM&gt;"can't display the data because PowerBI can't determine the relationship between two or more fields" &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Indeed they are 2 different tables from 2 different queries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Time1/Depth1 and Time2/Depth2 are from 2 different datatables in the same powerbi, I opened a Py-Python Visual,&amp;nbsp;draged and droped those tables in the "Values" field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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...&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;matplotlib&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;pyplot&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;plt&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;numpy&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;np&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;plt&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;subplots&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;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t;SPAN&gt;y1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'r--'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;plot&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;x2&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;y2&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'--'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;plt&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;show&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Jan 2025 10:29:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4363118#M173225</guid>
      <dc:creator>NicoBoss</dc:creator>
      <dc:date>2025-01-14T10:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Overlaying graphs with independant tables using python or ...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4366042#M173358</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912323" data-lia-user-login="NicoBoss" class="lia-mention lia-mention-user"&gt;NicoBoss&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much govind_021&amp;nbsp;for your prompt reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If Time1 is not equal to Time2, I suggest you create a bridge table as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“Time1”&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Time2"&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Bridge Table = 
UNION(
    SELECTCOLUMNS(
        'Table1',
        "Time",
        'Table1'[Time1]),
        SELECTCOLUMNS(
        'Table2',
        "Time",
        'Table2'[Time2])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table1 and Table2 create relationships with the bridge table respectively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a Python visual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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()
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 01:57:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Overlaying-graphs-with-independant-tables-using-python-or/m-p/4366042#M173358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-16T01:57:28Z</dc:date>
    </item>
  </channel>
</rss>

