<?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: rolling mtd of working days with slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3452886#M131560</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) We can create a table. Use the column of the new table as slicer.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SlicerTable = GENERATESERIES(1,35,1)&lt;/LI-CODE&gt;
&lt;P&gt;(3)We can create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _a=CALCULATE(SUM('Fact table'[TotalFacialValue]),FILTER(ALLSELECTED('Calendar'),[# working days]&amp;lt;= SELECTEDVALUE('SlicerTable'[slicer working day]) &amp;amp;&amp;amp; [# working days]=1 &amp;amp;&amp;amp; 'Calendar'[WorkDay]&amp;lt;&amp;gt;0))
var _b=CALCULATE(SUM('Fact table'[TotalFacialValue]),FILTER(ALLSELECTED('Calendar'),[# working days]&amp;lt;= SELECTEDVALUE('SlicerTable'[slicer working day]) &amp;amp;&amp;amp; [# working days]&amp;lt;&amp;gt;1 &amp;amp;&amp;amp; [# working days]&amp;lt;&amp;gt;0))
return IF([# working days]=SELECTEDVALUE('SlicerTable'[slicer working day]),_a+_b,BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;(4) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 06:14:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-09-29T06:14:01Z</dc:date>
    <item>
      <title>rolling mtd of working days with slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3449784#M131370</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to have a measure that calculates the rolling sum of working days from the beginning of the month until the selected working day.&lt;/P&gt;&lt;P&gt;I have a Date table where I created:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;weekday =&lt;/SPAN&gt; &lt;SPAN&gt;WEEKDAY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I created the number of working days in the month:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# working days =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;TOTALMTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[workday]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN&gt;TOTALMTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[workday]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Fact table with the column TotalFacialValue&lt;/DIV&gt;&lt;DIV&gt;One slicer with Year/Month&lt;/DIV&gt;&lt;DIV&gt;One Slicer with # working days&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I need to calculate rolling MTD from the begining of the selected Year/Month, until the selected # working days&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: If I will select # of working numbers = 10 with January/2022, the measure will calculate from 3rd of January( the first working day in the month), until 14th of January (the 10th working day)&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Sep 2023 12:54:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3449784#M131370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-27T12:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: rolling mtd of working days with slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3452886#M131560</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) We can create a table. Use the column of the new table as slicer.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SlicerTable = GENERATESERIES(1,35,1)&lt;/LI-CODE&gt;
&lt;P&gt;(3)We can create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _a=CALCULATE(SUM('Fact table'[TotalFacialValue]),FILTER(ALLSELECTED('Calendar'),[# working days]&amp;lt;= SELECTEDVALUE('SlicerTable'[slicer working day]) &amp;amp;&amp;amp; [# working days]=1 &amp;amp;&amp;amp; 'Calendar'[WorkDay]&amp;lt;&amp;gt;0))
var _b=CALCULATE(SUM('Fact table'[TotalFacialValue]),FILTER(ALLSELECTED('Calendar'),[# working days]&amp;lt;= SELECTEDVALUE('SlicerTable'[slicer working day]) &amp;amp;&amp;amp; [# working days]&amp;lt;&amp;gt;1 &amp;amp;&amp;amp; [# working days]&amp;lt;&amp;gt;0))
return IF([# working days]=SELECTEDVALUE('SlicerTable'[slicer working day]),_a+_b,BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;(4) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:14:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3452886#M131560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-29T06:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: rolling mtd of working days with slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3455522#M131713</link>
      <description>&lt;P&gt;Thank you, it's working.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 06:50:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-mtd-of-working-days-with-slicer-selection/m-p/3455522#M131713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-02T06:50:47Z</dc:date>
    </item>
  </channel>
</rss>

