<?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: Add a filter to a variable in a measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3989735#M154699</link>
    <description>&lt;P&gt;Do you have enough information to feed the NETWORKDAYS function?&amp;nbsp; It needs to know what your definition of a weekend is, and you need to provide a reference to the holiday table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively your calendar table should have a flag "working day"&amp;nbsp; that you can use instead.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2024 00:22:34 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-06-13T00:22:34Z</dc:date>
    <item>
      <title>Add a filter to a variable in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3988680#M154589</link>
      <description>&lt;P&gt;Hi Folks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to divide the output of a variable by a figure inside a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure is as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Capacity allocated = 
var a = SUMMARIZECOLUMNS('Resourcing'[Name],'Resourcing'[Start Date],'Resourcing'[End Date],'Resourcing'[Capacity],'dimDates'[Date])
var b = ADDCOLUMNS(a,"sm",if([Start Date]&amp;lt;=[Date] &amp;amp;&amp;amp; [Date]&amp;lt;=[End Date],[Capacity]))
return sumx(b,[sm])&lt;/LI-CODE&gt;&lt;P&gt;I was advised to filter either variable a or variable b by NETWORKDAYS. Not sure how to write this into the measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Overall the aim is to have a figure for each month of what &lt;EM&gt;capacity has been allocated&lt;/EM&gt;. At the moment, using the variable above, it is producing a figure per month of what will be &lt;EM&gt;worked&lt;/EM&gt;&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;The Y axis should only really go up to 40 at the max (1.0 as capacity= 1 member of staff), I have extended to show the stats for each month as they currently are&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 13:01:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3988680#M154589</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-06-12T13:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add a filter to a variable in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3989735#M154699</link>
      <description>&lt;P&gt;Do you have enough information to feed the NETWORKDAYS function?&amp;nbsp; It needs to know what your definition of a weekend is, and you need to provide a reference to the holiday table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively your calendar table should have a flag "working day"&amp;nbsp; that you can use instead.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 00:22:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3989735#M154699</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-13T00:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add a filter to a variable in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3990364#M154755</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;- great to see you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dimDates table has:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Weekday&lt;/STRONG&gt; - Sunday as 0, Monday as 1 etc, running through the week&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WeekdayWeekend&lt;/STRONG&gt; - Weekday and Weekend choice&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IsBankHoliday&lt;/STRONG&gt; - True or False choice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked on one individual staff who had just one work item for a given month of 0.5 capacity allocated to work and her current monthly figure 'worked' is 10.5. This is not correct as the current measure is multiplying this 0.5 by the working days ie 21 x 0.5 = 10.5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The figure that staff (therefore the Y axis figure) should have for that month should be 0.5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work the same if moving up a level to Deputy Director, and then without any column legend giving the whole teams capacity allocated for a given month, instead of multiplying the total capacity by the number of working days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you could show how we amend the measure to correctly show capacity allocated instead of capacity 'worked', that would be great&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 21:17:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3990364#M154755</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-06-13T21:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add a filter to a variable in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3995677#M155201</link>
      <description>&lt;P&gt;Hi Folks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any suggestions on solving this most welcome!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 08:54:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3995677#M155201</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-06-17T08:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add a filter to a variable in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3997772#M155475</link>
      <description>&lt;P&gt;Still trying to solve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the current measure which is calculating the capacity allocated (but incorrectly adding up each staff members capacity for each day in a month eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0.5 for each day in a 31 day month is being mutlplied as 0.5 x 31 = 15.5, whereas it should be 0.5 for the month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Capacity allocated = 
var a = SUMMARIZECOLUMNS('Resourcing'[Name],'Resourcing'[Start Date],'Resourcing'[End Date],'Resourcing'[Capacity],'dimDates'[Date])
var b = ADDCOLUMNS(a,"sm",if([Start Date]&amp;lt;=[Date] &amp;amp;&amp;amp; [Date]&amp;lt;=[End Date],[Capacity]))
return sumx(b,[sm])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 options it seems now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. rewrite the measure so it calculates correctly&lt;/P&gt;&lt;P&gt;2. use NETWORKDAYS to divide one of the variables in the above measure (or some other way) to get the correct capacity allocated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In theory, number 2 works, but not sure a) if its possible and b) if it is the best way to calculate the capacity allocated for any time measure for however many staff have capacity allocated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the NETWORKDAYS working outside of the above measure, but using dates from a different table (as the Resourcing table is pivoted) and applying on data outside of the resourcing table, not sure if it will apply to the start and end dates in the Resourcing table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Working Days = Var Start_Date = SELECTEDVALUE('Work Tracker'[Start Date])
var End_Date = SELECTEDVALUE('Work Tracker'[End Date])
RETURN
NETWORKDAYS(Start_Date, End_Date)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Jun 2024 08:16:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3997772#M155475</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-06-18T08:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add a filter to a variable in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3997802#M155478</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;- not sure if you could help with this one- I saw you had a solution to a related problem here:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Using-a-Measure-as-a-filter-in-DAX-formula/m-p/395330" target="_blank" rel="noopener"&gt;Solved: Using a Measure as a filter in DAX formula - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 08:26:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-a-filter-to-a-variable-in-a-measure/m-p/3997802#M155478</guid>
      <dc:creator>SteveMForm</dc:creator>
      <dc:date>2024-06-18T08:26:10Z</dc:date>
    </item>
  </channel>
</rss>

