<?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: DAX DAYSYTD not generating expected results in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3474073#M132693</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="630360" data-lia-user-login="ClaudioCavalli" class="lia-mention lia-mention-user"&gt;ClaudioCavalli&lt;/a&gt;&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 17:57:37 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-10-12T17:57:37Z</dc:date>
    <item>
      <title>DAX DAYSYTD not generating expected results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3474025#M132688</link>
      <description>&lt;P&gt;I have just started using Time Intelligence functions in DAX and I am running into problems with the DATESYTD function. I have an Access Database that has three queries/tables that I use:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;PivotQuery&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;PivotFTEQuery&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Calendar&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The two pivot queries have a Date field called Tdate. The Calendar table has a Date field called CaledarDate. THere is a relationship between these tables in Access and I also create a realationship in my PowerPivot model. Now, all transactions that are downloaded in the database have a Day number of 1. So, all transactions in a month happen on the first day of the month.&lt;/P&gt;&lt;P&gt;I also have to deal with a fiscal year starting on July 1st.&lt;/P&gt;&lt;P&gt;The PivotQuery table has a field called Tvalue.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I created a first measure as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TvalueSum=CALCULATE(sum(PivotQuery[Tvalue]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To create an explicit measure for the sum of the transactions’ amounts.&amp;nbsp; This measure works well as it matches the implicit measure “Sum of Tvalue”.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I create the TvalueYTD as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TvalueYTD=CALCULATE([TvalueSum],DATESYTD('Calendar'[CalendarDate], “6/30”))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And this formula gives me blanks.&amp;nbsp; If I remove the end of fiscal year parameter, I get the same number in all the months form July to December and blanks in the other months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The funny thing is that I do not understand where the numbers come from.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please note that I have data in my DB from 7/1/2021 to 6/1/2024.&amp;nbsp; I have tried to use several dates in the Calendar table:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Dates than more than overlap the dates in use:&amp;nbsp; Specifically, I had dates from 1/1/2021 to 12/31/2021.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Dates that overlap the start date:&amp;nbsp; From 1/1/2021 to 6/30/2021.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Dates that overlap the end date:&amp;nbsp; From 7/1/2021 to 12/31/2021.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Dates that match the start and &amp;nbsp;end dates:&amp;nbsp; From 7/1/2021 to 6/30/2021 (AND from 7/1/2021 to 6/1/2021).&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;No matter what the formula gives the same results:&amp;nbsp; Blank if I have an end of fiscal year parameter and the unknown number which is the same for each month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since I cannot seem to be able to debug the DAX code (I am using only Excel at this time) I created another measure to see why I get the same numbers:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TvalueCount=calculate(COUNTROWS(PivotQuery), DATESYTD('Calendar'[CalendarDate]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I thought this would give me the number of rows in each month on a YTD basis.&amp;nbsp; Well this&amp;nbsp; formula also gives the same number of rows for each month.&amp;nbsp; I also cannot figure out where this number is coming from.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I thought, well there is a very useful tool that I can use.&amp;nbsp; I can double click on the numbers in the pivot and get the rows that make up that number.&amp;nbsp; So I did so for every month number, and guess what?&amp;nbsp; I add the Tvalues of the rows included and they match each&amp;nbsp; month value, but it does not match the number shown in the pivot.&amp;nbsp; Also each month had a different number of rows, not the same number that is shown in the pivot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Finally, this works with the blank rows.&amp;nbsp; If I run the measure with the “06/30” end of year parameter I will get the blank results.&amp;nbsp; But if I double click on each of the blank results I will get the same rows (one&amp;nbsp; by one) as if I remove the parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Where should I look to resolve this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S.&amp;nbsp;Somembody mentioned on the Excel forum that my date format might be incorrect so I tried both "6/30" or "6-30" and the results are the same.&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;&lt;SPAN&gt;Also what do I need to debug DAX statements?&amp;nbsp; Can I export the model so I can upload it somewhere or import it in another worksheet?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for any help.&amp;nbsp; I&amp;nbsp; have been looking for an answer of the web, but so far I came up empty.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 17:07:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3474025#M132688</guid>
      <dc:creator>ClaudioCavalli</dc:creator>
      <dc:date>2023-10-12T17:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX DAYSYTD not generating expected results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3474073#M132693</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="630360" data-lia-user-login="ClaudioCavalli" class="lia-mention lia-mention-user"&gt;ClaudioCavalli&lt;/a&gt;&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 17:57:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3474073#M132693</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-10-12T17:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX DAYSYTD not generating expected results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3484182#M133289</link>
      <description>&lt;P&gt;Ok,&amp;nbsp; time to fess up.&amp;nbsp; My formula was working the WHOLE time.&amp;nbsp; I have been banging my head against this problem for three weeks.&amp;nbsp; Here is the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my Calendar table I have&amp;nbsp; field called MonthNumberFiscal, since our fiscal year starts on 7/1.&amp;nbsp; I was using MonthNumberFiscal to list the months.&amp;nbsp; There is one HUGE problem with this:&amp;nbsp; MonthNumberFiscal is the same across multiple years, so you cannot calculate a YTD number across multiple years.&lt;/P&gt;&lt;P&gt;As soon as I replaced MonthNumberFiscal with the actual date field, the numbers appeared.&amp;nbsp; I figure I would share in case someone runs into a similar problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Your YTD functions will not work across multiple years&lt;/STRONG&gt;.&amp;nbsp; When you say it like that, it makes sense but it took me three weeks to figure out that is exactly what I was doing.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 21:15:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-DAYSYTD-not-generating-expected-results/m-p/3484182#M133289</guid>
      <dc:creator>ClaudioCavalli</dc:creator>
      <dc:date>2023-10-18T21:15:01Z</dc:date>
    </item>
  </channel>
</rss>

