<?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 Calculate Selected Year &amp;amp; Month's YTD and Previous year ytd for the same month in filter selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753518#M146440</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;I am struggling to calculate ytd for the selected year &amp;amp; month&amp;nbsp; and previous year YTD for the same selected month in filter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;For example, if i select FY 2023 YTD July in filter, it should provide me the year to date value starts from Jan 2023 upto July 2023. And it should also provide me the previous year to date value starts from Jan 2022 upto July 2022.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 10 Mar 2024 20:24:53 GMT</pubDate>
    <dc:creator>insandur</dc:creator>
    <dc:date>2024-03-10T20:24:53Z</dc:date>
    <item>
      <title>Calculate Selected Year &amp; Month's YTD and Previous year ytd for the same month in filter selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753518#M146440</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;I am struggling to calculate ytd for the selected year &amp;amp; month&amp;nbsp; and previous year YTD for the same selected month in filter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;For example, if i select FY 2023 YTD July in filter, it should provide me the year to date value starts from Jan 2023 upto July 2023. And it should also provide me the previous year to date value starts from Jan 2022 upto July 2022.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 10 Mar 2024 20:24:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753518#M146440</guid>
      <dc:creator>insandur</dc:creator>
      <dc:date>2024-03-10T20:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Selected Year &amp; Month's YTD and Previous year ytd for the same month in filter selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753539#M146441</link>
      <description>&lt;P&gt;Please try the "Running totals" Quick Measure.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 21:05:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753539#M146441</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-10T21:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Selected Year &amp; Month's YTD and Previous year ytd for the same month in filter selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753544#M146442</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="392174" data-lia-user-login="insandur" class="lia-mention lia-mention-user"&gt;insandur&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can also try with explicit measures:&lt;/P&gt;&lt;P&gt;1. Total YTD&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Total YTD = 
CALCULATE(
    SUM ( 'Fact'[Value] ),
    DATESYTD('Calendar'[Date])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Total PYTD&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total PYTD = 
CALCULATE(
    [Total YTD],
    DATEADD(
        'Calendar'[Date],-1,YEAR)
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 21:14:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3753544#M146442</guid>
      <dc:creator>StrategicSavvy</dc:creator>
      <dc:date>2024-03-10T21:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Selected Year &amp; Month's YTD and Previous year ytd for the same month in filter selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3757065#M146572</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="392174" data-lia-user-login="insandur" class="lia-mention lia-mention-user"&gt;insandur&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please &lt;SPAN&gt;try the following methods and check if they can solve your problem:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the simple table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.Select the slicer visual and drag the month into the visual.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3.Select the slicer visual and drag the year into the visual.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4.Create the measure to calculate YTD.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;YTD = CALCULATE (
        SUM ('Table'[Values]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = SELECTEDVALUE('Table'[Year])
                &amp;amp;&amp;amp; 'Table'[Month] &amp;lt;= SELECTEDVALUE('Table'[Month])
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5.Create the measure to calculate previous YTD .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;pre_YTD = CALCULATE (
        SUM ('Table'[Values]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = (SELECTEDVALUE('Table'[Year]) - 1)
                &amp;amp;&amp;amp; 'Table'[Month] &amp;lt;= SELECTEDVALUE('Table'[Month])
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;6.Drag the measure into the card visual. The result is shown below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 06:25:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Selected-Year-amp-Month-s-YTD-and-Previous-year-ytd/m-p/3757065#M146572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-12T06:25:34Z</dc:date>
    </item>
  </channel>
</rss>

