<?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: Total year to date not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203413#M116567</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="550729" data-lia-user-login="BeginnerAnalyst" class="lia-mention lia-mention-user"&gt;BeginnerAnalyst&lt;/a&gt;&amp;nbsp;See if this helps:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Year-to-Date-Total/m-p/2875532#M908" target="_blank"&gt;Better Year to Date Total - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this video that presents better alternatives for YTD, QTD, MTD and WTD:&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/rOpwLzplUVI" data-video-remote-vid="https://youtu.be/rOpwLzplUVI" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrOpwLzplUVI%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrOpwLzplUVI&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrOpwLzplUVI%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 17:01:58 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-04-24T17:01:58Z</dc:date>
    <item>
      <title>Total year to date not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203391#M116564</link>
      <description>&lt;P&gt;Hello everyone)&lt;/P&gt;&lt;P&gt;I have pbi report with sales bonus calculation.&lt;/P&gt;&lt;P&gt;All data is in the table called "Revenue".&lt;/P&gt;&lt;P&gt;I need to create a measure that will sum values total to date for every manager from&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Quarter payment" column / measure.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My current measure for YTD values is:&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;YTD payment = &lt;/SPAN&gt;&lt;SPAN&gt;TOTALYTD&lt;/SPAN&gt;&lt;SPAN&gt;([Quarter payment], 'Calendar'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But it is not working:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expected result for selected manager should be:&lt;/P&gt;&lt;P&gt;Q1 2023 - 2 693.93&lt;/P&gt;&lt;P&gt;Q2 2023 - 8 887.13&lt;/P&gt;&lt;P&gt;Q3 2023 - 16 320.03&lt;/P&gt;&lt;P&gt;Q4 2023 - 25 240.33&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody help me in creating correct measure "&lt;SPAN&gt;YTD payment"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is pbix file: &lt;A href="https://drive.google.com/file/d/18mC4bQjEwjldfHZ2XxxlXeQVxu3au5Za/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/18mC4bQjEwjldfHZ2XxxlXeQVxu3au5Za/view?usp=sharing&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:02:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203391#M116564</guid>
      <dc:creator>BeginnerAnalyst</dc:creator>
      <dc:date>2023-04-24T17:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Total year to date not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203413#M116567</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="550729" data-lia-user-login="BeginnerAnalyst" class="lia-mention lia-mention-user"&gt;BeginnerAnalyst&lt;/a&gt;&amp;nbsp;See if this helps:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Year-to-Date-Total/m-p/2875532#M908" target="_blank"&gt;Better Year to Date Total - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this video that presents better alternatives for YTD, QTD, MTD and WTD:&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/rOpwLzplUVI" data-video-remote-vid="https://youtu.be/rOpwLzplUVI" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrOpwLzplUVI%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrOpwLzplUVI&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrOpwLzplUVI%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:01:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203413#M116567</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-04-24T17:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Total year to date not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203425#M116569</link>
      <description>&lt;P&gt;thx, but this is not working solution for my case(&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:06:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203425#M116569</guid>
      <dc:creator>BeginnerAnalyst</dc:creator>
      <dc:date>2023-04-24T17:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Total year to date not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203646#M116595</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="550729" data-lia-user-login="BeginnerAnalyst" class="lia-mention lia-mention-user"&gt;BeginnerAnalyst&lt;/a&gt;&amp;nbsp;Here's the start of it, you'll have to add in the rest of your logic.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
    VAR __MaxDate = MAX('Calendar'[Date])
    VAR __Manager = MAX('Revenue'[Manager Name])
    VAR __YearQuarter = YEAR(__MaxDate) * 100 + QUARTER(__MaxDate)
    VAR __PrevYearQuarter = IF(QUARTER(__MaxDate) = 1, ( YEAR(__MaxDate) - 1 ) * 100 + 4, YEAR(__MaxDate) * 100 + QUARTER(__MaxDate) - 1)
    VAR __Table = 
        SUMMARIZE(
            FILTER(ALLSELECTED('Revenue'), [Type] = "Actual"),
            [date],
            "__YQ", YEAR([date]) * 100 + QUARTER([date]),
            "__Payment", SUM('Revenue'[amount usd])
        ) 
    VAR __Quarter = SUMX(FILTER(__Table, [__YQ] = __YearQuarter), [__Payment])
    VAR __PQ = SUMX(FILTER(__Table, [__YQ] = __PrevYearQuarter), [__Payment])
    VAR __Result = DIVIDE( __Quarter - __PQ, __PQ)
RETURN
    __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Apr 2023 19:57:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3203646#M116595</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-04-24T19:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Total year to date not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3204616#M116669</link>
      <description>&lt;P&gt;thank you for reply) but the idea is not to sum&amp;nbsp;Revenue'[amount usd]. I need to sum quarter payments cumulative to date for each year.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 08:52:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-year-to-date-not-working/m-p/3204616#M116669</guid>
      <dc:creator>BeginnerAnalyst</dc:creator>
      <dc:date>2023-04-25T08:52:21Z</dc:date>
    </item>
  </channel>
</rss>

