<?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: Calculated Measure SUM in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2633869#M77162</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409438" data-lia-user-login="ferdri3" class="lia-mention lia-mention-user"&gt;ferdri3&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;Table：&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Date:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag =
var _select=SELECTEDVALUE('Date'[Date])
return
IF(
    AND( _select &amp;gt;=MAX('Table'[Join date]) ,
    _select &amp;lt;MAX('Table'[Leave date])) ||
    AND( _select &amp;gt;=MAX('Table'[Join date]) ,
    MAX('Table'[Leave date])=BLANK()) ,"Working", "Not Working")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Working Card =
COUNTX(
    FILTER(ALL('Table'),
    [Flag]="Working"),[Full name])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you need pbix, please click &lt;A href="https://m365x668238-my.sharepoint.com/:u:/g/personal/yangliu_m365x668238_onmicrosoft_com/ETB77ZKrH4lJm1OHpbhv8NsB_Kw3-ko8bdXj52QKEjVMeQ?e=XfLhXe" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2022 13:59:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-12T13:59:35Z</dc:date>
    <item>
      <title>Calculated Measure SUM</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2622384#M76437</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been at this for quite some hours now, so I decided to see if there is some help out here haha.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on an HR dashboard and they requested to see some teams back in time.&lt;/P&gt;&lt;P&gt;To keep it simple, I have 5 columns: Index column, Full name, Join date, Leave date (blank if still active employees) and FTE.&lt;/P&gt;&lt;P&gt;In a seperate file I keep all dates (gregorian and fyscal).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To see a list (matrix) with people who worked in a team at a point in time I used the following calculated measure to see if they are "Working" or "Not Working" on the date selected in the slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Working = 
VAR Selected_Date =
    MAX ( 'DateTable'[Gregorian Date] )
RETURN
    SWITCH (
        TRUE (),
        MIN ( 'Consolidated'[Join Date] ) &amp;lt;= Selected_Date
            &amp;amp;&amp;amp; MAX ( 'Consolidated'[Leave Date] ) &amp;gt;= Selected_Date, "Working",
        MIN ( 'Consolidated'[Join Date] ) &amp;lt;= Selected_Date
            &amp;amp;&amp;amp; MAX ( 'Consolidated'[Leave Date] ) = BLANK (), "Working",
        "Not Working"
    )&lt;/LI-CODE&gt;&lt;P&gt;...this part works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give a single number in a card of the sum total, I use the following code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Working Card = COUNTROWS(FILTER(DISTINCT('Consolidated'[Index]), [Working] = "Working"))&lt;/LI-CODE&gt;&lt;P&gt;This works nicely as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The feedback I got was they would like to see the total of FTE (which can for example be 0,8 for some employees as well), not so much the amount of people (countrows).&lt;/P&gt;&lt;P&gt;Everything I try to sum up the FTE does not work and gives me errors as a calculated measure cannot be used in a true/false statement etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone got any tips for this one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for you time and help!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 11:40:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2622384#M76437</guid>
      <dc:creator>ferdri3</dc:creator>
      <dc:date>2022-07-06T11:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure SUM</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2622608#M76452</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409438" data-lia-user-login="ferdri3" class="lia-mention lia-mention-user"&gt;ferdri3&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I assume that you are slicing by date. then plesae try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Total FTE =
SUMX (
    VALUES ( 'DateTable'[Gregorian Date] ),
    CALCULATE (
        VAR Selected_Date =
            MAX ( 'DateTable'[Gregorian Date] )
        RETURN
            SWITCH (
                TRUE (),
                MIN ( 'Consolidated'[Join Date] ) &amp;lt;= Selected_Date
                    &amp;amp;&amp;amp; MAX ( 'Consolidated'[Leave Date] ) &amp;gt;= Selected_Date, SUM ( 'Consolidated'[FTE] ),
                MIN ( 'Consolidated'[Join Date] ) &amp;lt;= Selected_Date
                    &amp;amp;&amp;amp; MAX ( 'Consolidated'[Leave Date] ) = BLANK (), SUM ( 'Consolidated'[FTE] )
            )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 13:07:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2622608#M76452</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-06T13:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure SUM</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2633869#M77162</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409438" data-lia-user-login="ferdri3" class="lia-mention lia-mention-user"&gt;ferdri3&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;Table：&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Date:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag =
var _select=SELECTEDVALUE('Date'[Date])
return
IF(
    AND( _select &amp;gt;=MAX('Table'[Join date]) ,
    _select &amp;lt;MAX('Table'[Leave date])) ||
    AND( _select &amp;gt;=MAX('Table'[Join date]) ,
    MAX('Table'[Leave date])=BLANK()) ,"Working", "Not Working")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Working Card =
COUNTX(
    FILTER(ALL('Table'),
    [Flag]="Working"),[Full name])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you need pbix, please click &lt;A href="https://m365x668238-my.sharepoint.com/:u:/g/personal/yangliu_m365x668238_onmicrosoft_com/ETB77ZKrH4lJm1OHpbhv8NsB_Kw3-ko8bdXj52QKEjVMeQ?e=XfLhXe" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 13:59:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-SUM/m-p/2633869#M77162</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-12T13:59:35Z</dc:date>
    </item>
  </channel>
</rss>

