<?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: Calculate sum of the difference between 2 columns from different table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524142#M70517</link>
    <description>&lt;P&gt;I'm sorry, but can you explain better how to do that?&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 18:26:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-18T18:26:12Z</dc:date>
    <item>
      <title>Calculate sum of the difference between 2 columns from different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2523989#M70505</link>
      <description>&lt;P&gt;&lt;FONT color="#FF0000"&gt;EDIT:&lt;BR /&gt;Thank you all for the help, but I just found a solution for my problem&lt;/FONT&gt;&lt;BR /&gt;_________________________________________________________________________________________&lt;BR /&gt;Hi.&lt;BR /&gt;I have 2 tables:&lt;/P&gt;&lt;P&gt;Table Team: that has 3 columns: the names of the employees, their date of admission and, if applied, the date when they left the company&lt;/P&gt;&lt;P&gt;Table BSC: that has 2 columns: years and months, since 2020&lt;BR /&gt;&lt;BR /&gt;I want to know how long my employees stayed in my company at the different dates on the BSC table. To simplify, for now, I am not considering the date they left the company. I created a representation on excel to make it simpler to understand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Basically for each combination of year/month in my BSC table, I create a new column in the BSC table with sum of the difference between the last day of that month and the date of admission for all my employees.&lt;BR /&gt;My DAX code would look like this:&lt;BR /&gt;Column = CALCULATE( SUMX (Team, Team[dateofadmission] - DATE( BSC[year], BSC[month], DAY(EOMONTH(DATE(BSC[year], BSC[month],1),0)) , FILTER (...) )&lt;BR /&gt;The problem with this formula is that I can't retrieve the columns from both of my tables. Do you have any idea of how I can calculate this?&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:16:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2523989#M70505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T19:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum of the difference between 2 columns from different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524023#M70508</link>
      <description>&lt;P&gt;llo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;Employee calc is my name table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 17:21:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524023#M70508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T17:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum of the difference between 2 columns from different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524098#M70514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why don't you just creat a table visual as a measure?&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 17:55:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524098#M70514</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-18T17:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum of the difference between 2 columns from different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524142#M70517</link>
      <description>&lt;P&gt;I'm sorry, but can you explain better how to do that?&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 18:26:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524142#M70517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T18:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum of the difference between 2 columns from different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524144#M70518</link>
      <description>&lt;P&gt;The problem is that, in reality, that information is on 2 separate tables&lt;BR /&gt;I just put it like that in the excel to explain what I wanted to do&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 18:27:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524144#M70518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T18:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum of the difference between 2 columns from different table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524184#M70521</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;NewMeasure =
VAR CurrentMonth =
    SELECTEDVALUE ( BSC[month] )
VAR CurrentYear =
    SELECTEDVALUE ( BSC[year] )
VAR CurrentDate =
    DATE ( CurrentYear, CurrentMonth, DAY ( EOMONTH ( DATE ( CurrentYear, CurrentMonth, 1 ), 0 ) ) )
RETURN
    SUMX (
        Team,
        VAR StartDate = Team[dateofadmission]
        VAR EndDate =
            IF (
                ISBLANK ( Team[dateoftermination] ),
                CurrentDate,
                MAX ( CurrentDate, Team[dateoftermination] )
            )
        RETURN
            EndDate - StartDate
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 May 2022 18:51:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-sum-of-the-difference-between-2-columns-from-different/m-p/2524184#M70521</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-18T18:51:41Z</dc:date>
    </item>
  </channel>
</rss>

