<?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: Subtract two columns from different table per monthly basis using DAX in power bi in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839479#M6331</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="180203" data-lia-user-login="PreetiSahu321" class="lia-mention lia-mention-user"&gt;PreetiSahu321&lt;/a&gt;&amp;nbsp; Please create column in Order table&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Column = 'Order'[Net value]-LOOKUPVALUE(Invoice[Sales],Invoice[Bill Date],'Order'[Req.dlv.dt])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 07 Nov 2019 06:21:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-07T06:21:12Z</dc:date>
    <item>
      <title>Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/838566#M6294</link>
      <description>&lt;P&gt;Hello Power BI Community Members,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have two tables as&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Orders&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Invoices&lt;/STRONG&gt;&lt;SPAN&gt;. There is one common column in both&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Orders&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Invoices&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;tables i.e.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;BillDate&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(Date and Time Datatype). In the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Orders&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;table, It has one column named as a&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Net value&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;whose data type is the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Whole Number&lt;/STRONG&gt;&lt;SPAN&gt;. Similarly, in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Invoices&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;table, It has a column named as&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Sales US$&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;(Whole Number Datatype). As per my requirement, I want to subtract these two columns per monthly basis. Let me explain to you properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By using the below screenshot, you can see below are my two tables as Orders and Invoices. I want to subtract the values from&amp;nbsp;&lt;STRONG&gt;Net value&amp;nbsp;&lt;/STRONG&gt;to&amp;nbsp;&lt;STRONG&gt;Sales US$&lt;/STRONG&gt;&amp;nbsp;of the current month. As this is November month is going on, So it will subtract the values for the current month only. i.e. (132453-10600=121853)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As I am new to Power BI, I do not have much knowledge about this Power BI DAX rules.&amp;nbsp;Please, Can anyone suggest to me what I have to do in this case?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:50:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/838566#M6294</guid>
      <dc:creator>PreetiSahu321</dc:creator>
      <dc:date>2019-11-06T10:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/838591#M6296</link>
      <description>&lt;LI-CODE lang="markup"&gt;Column = 'Order'[Net Value]-LOOKUPVALUE(Invoice[Sales US],Invoice[Year],'Order'[Year],Invoice[Month],'Order'[Month],0)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:22:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/838591#M6296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T11:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839441#M6330</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you suggest to me how you have used &lt;STRONG&gt;"Invoice[Year], 'Order'[Year], Invoice[Month], 'Order'[Month]" &lt;/STRONG&gt;in the above formula. Because when I am adding this in the new column, it is showing me an error that those columns are not existing in the tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I have added this below formula in the column and it is showing me the wrong value as you can see in the below screenshot.&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;One more thing I want to tell is, For the&amp;nbsp;&lt;STRONG&gt;Invoices&lt;/STRONG&gt; table, it is &lt;STRONG&gt;Bill Date&lt;/STRONG&gt; whereas, in the &lt;STRONG&gt;Orders&lt;/STRONG&gt; table, it is &lt;STRONG&gt;Req.dlv.dt&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;As I am new to Power BI, I don't have much knowledge about Dax. Please suggest me what I have to do?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 05:35:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839441#M6330</guid>
      <dc:creator>PreetiSahu321</dc:creator>
      <dc:date>2019-11-07T05:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839479#M6331</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="180203" data-lia-user-login="PreetiSahu321" class="lia-mention lia-mention-user"&gt;PreetiSahu321&lt;/a&gt;&amp;nbsp; Please create column in Order table&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Column = 'Order'[Net value]-LOOKUPVALUE(Invoice[Sales],Invoice[Bill Date],'Order'[Req.dlv.dt])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 07 Nov 2019 06:21:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839479#M6331</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-07T06:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839493#M6332</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have created a new column in the Orders list and applied this formula but it is not working for me and appearing the below error. Also, In the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Invoices&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;list, the Bill Date is&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"MM/DD/YYYY"&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in format. Similarly, in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Orders&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;list, the Req.dlv.dt is&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"MM/DD/YYYY"&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in format.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 06:34:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839493#M6332</guid>
      <dc:creator>PreetiSahu321</dc:creator>
      <dc:date>2019-11-07T06:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839569#M6334</link>
      <description>&lt;P&gt;Its better to create a date table. Then use the date on the date table for reporting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Connect the two table using date&lt;/P&gt;&lt;P&gt;ie:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure = SUM(Order[Net Value]) - SUM(Invoices[Sales US$])&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 07:48:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839569#M6334</guid>
      <dc:creator>kmagat</dc:creator>
      <dc:date>2019-11-07T07:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839593#M6335</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="184544" data-lia-user-login="kmagat" class="lia-mention lia-mention-user"&gt;kmagat&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said, I have created a Date table and made a relationship with those two tables (Orders and Invoices). But still, it is not showing me the correct value that I am expecting. You can see my sample report by using this below link:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/z53yixseqlhh09a/Current%20Month%20Order%20To%20Ship.pbix?dl=0" target="_self"&gt;Sample Report&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 08:13:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839593#M6335</guid>
      <dc:creator>PreetiSahu321</dc:creator>
      <dc:date>2019-11-07T08:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two columns from different table per monthly basis using DAX in power bi</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839708#M6337</link>
      <description>&lt;LI-CODE lang="markup"&gt;Measure = 
VAR NetValue = CALCULATE(SUM(Orders[Net value]))
VAR yyyy = MAXX(Orders,Orders[Req.dlv.dt].[Year])
VAR MM = MAXX(Orders,Orders[Req.dlv.dt].[MonthNo])
VAR Sales = CALCULATE(SUM(Invoices[Sales US$]),FILTER(ALL(Invoices),YEAR(Invoices[Bill Date])=yyyy&amp;amp;&amp;amp;MONTH(Invoices[Bill Date])=MM))
RETURN NetValue-Sales&lt;/LI-CODE&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="180203" data-lia-user-login="PreetiSahu321" class="lia-mention lia-mention-user"&gt;PreetiSahu321&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 09:42:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-columns-from-different-table-per-monthly-basis/m-p/839708#M6337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-07T09:42:31Z</dc:date>
    </item>
  </channel>
</rss>

