<?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: Custom Year to Date Flag in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3558796#M137103</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="462987" data-lia-user-login="oritam3210" class="lia-mention lia-mention-user"&gt;oritam3210&lt;/a&gt;,&amp;nbsp;thanks for your reply. I had seen that way if doing things, but ideally I want to create the column so it will dynamically flag each date to be included in the custom YTD or not, changing daily. I could then use that as a slicer so I can switch the YTD on or off on a page of my dashboard to flick between the two views, rather than have to have two separate visuals. Do you know of a way I could achieve this? Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 12:16:24 GMT</pubDate>
    <dc:creator>Andrew_Butcher</dc:creator>
    <dc:date>2023-11-29T12:16:24Z</dc:date>
    <item>
      <title>Custom Year to Date Flag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3549004#M136491</link>
      <description>&lt;P&gt;I would like to have a slicer which I can switch on and off Year to Date, with a year running 1st September to 31st August. I have a column in my calendar table with the formula below which flags YTD for a standard Jan-Dec calendar year, but struggling to work out how to customise this for different date. I have 10 years of data and need it to apply to previous years as well. e. g. 1st November should currently be flagged in this year and previous years, whereas 1st December should not yet be flagged in current or previous current years. Thanks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;= Table.AddColumn(#"Inserted Day of Year", "Flag_YTD", each if Date.DayOfYear([Date]) &amp;lt;= Date.DayOfYear(CurrentDate)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 12:47:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3549004#M136491</guid>
      <dc:creator>Andrew_Butcher</dc:creator>
      <dc:date>2023-11-23T12:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Year to Date Flag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3549771#M136543</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="594417" data-lia-user-login="Andrew_Butcher" class="lia-mention lia-mention-user"&gt;Andrew_Butcher&lt;/a&gt;,&lt;BR /&gt;Why do you want to use the calculated column?&lt;/P&gt;&lt;P&gt;you can calculate it on a measure, with DAX function&amp;nbsp;&lt;SPAN&gt;TOTALYTD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;see definition&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TOTALYTD(&amp;lt;expression&amp;gt;,&amp;lt;dates&amp;gt;[,&amp;lt;filter&amp;gt;][,&amp;lt;year_end_date&amp;gt;])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TOTALYTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey], ALL('DateTime'), "6/30") &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;**&lt;SPAN&gt;In this example, year_end_date can be specified as "6/30"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;linked to Microsoft DAX function&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/totalytd-function-dax" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/totalytd-function-dax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you have more then one measure,&lt;/P&gt;&lt;P&gt;you can use Calculation Group - it will activate the YTD function&amp;nbsp; on all measures&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;If you find this helpful, kindly consider marking it as &lt;STRONG&gt;'Accepted Solution.'&lt;/STRONG&gt;&lt;BR /&gt;This action helps others quickly find a reliable answer!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 22:13:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3549771#M136543</guid>
      <dc:creator>oritam3210</dc:creator>
      <dc:date>2023-11-23T22:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Year to Date Flag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3558796#M137103</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="462987" data-lia-user-login="oritam3210" class="lia-mention lia-mention-user"&gt;oritam3210&lt;/a&gt;,&amp;nbsp;thanks for your reply. I had seen that way if doing things, but ideally I want to create the column so it will dynamically flag each date to be included in the custom YTD or not, changing daily. I could then use that as a slicer so I can switch the YTD on or off on a page of my dashboard to flick between the two views, rather than have to have two separate visuals. Do you know of a way I could achieve this? Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 12:16:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3558796#M137103</guid>
      <dc:creator>Andrew_Butcher</dc:creator>
      <dc:date>2023-11-29T12:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Year to Date Flag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3558941#M137111</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="594417" data-lia-user-login="Andrew_Butcher" class="lia-mention lia-mention-user"&gt;Andrew_Butcher&lt;/a&gt;,&lt;BR /&gt;Do you want the column to be able to create a filter?&lt;/P&gt;&lt;P&gt;if so, you can achieve this exact functionality by using calculation groups.&lt;BR /&gt;you can create two calculation items, one does nothing (YTD off), and one manipulates all the measures on the report to custom YTD behavior.&lt;/P&gt;&lt;P&gt;BTW - there is a new look for calculation group in Power BI, see this link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/blog/deep-dive-into-the-model-explorer-with-calculation-group-authoring-and-creating-relationships-in-the-properties-pane/?cdn=disable" target="_blank"&gt;https://powerbi.microsoft.com/en-us/blog/deep-dive-into-the-model-explorer-with-calculation-group-authoring-and-creating-relationships-in-the-properties-pane/?cdn=disable&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that a quick solution for your case,&lt;/P&gt;&lt;P&gt;Good Luck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;If you find this helpful, kindly consider marking it as &lt;STRONG&gt;'Accepted Solution.'&lt;/STRONG&gt;&lt;BR /&gt;This action helps others quickly find a reliable answer!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 13:25:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Year-to-Date-Flag/m-p/3558941#M137111</guid>
      <dc:creator>oritam3210</dc:creator>
      <dc:date>2023-11-29T13:25:10Z</dc:date>
    </item>
  </channel>
</rss>

