<?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: YTD/ LTM show correct total but row values missing in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4318874#M171465</link>
    <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from DataNinja777&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="891594" data-lia-user-login="Dr_BB" class="lia-mention lia-mention-user"&gt;Dr_BB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;I believe the reason only one row of data is displayed is due to the interaction between the slicer and your visualisation object. The slicer's data comes from the original data, so it directly filters the original data rather than the expected result.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;Here is my solution:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;My sample data is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;Firstly, create the following calculation table. Ensure that there is no relationship established between this calculation table and the original table:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;slicert = DISTINCT(ALLEXCEPT('SALES','SALES'[STORE],'SALES'[SALES]))&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;SPAN&gt;Secondly, use the newly created calculation table as the slicer:&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 style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;3.&lt;/SPAN&gt;&lt;SPAN&gt;Next, create the following measure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;test_ytd =
VAR yr =
    SELECTEDVALUE ( 'slicert'[YEAR] )
VAR mn =
    SELECTEDVALUE ( 'slicert'[MONTH] )
VAR wk =
    SELECTEDVALUE ( 'slicert'[WEEK] )
VAR sales_ytd =
    CALCULATE (
        SUM ( 'SALES'[SALES] ),
        FILTER (
            ALLEXCEPT ( 'SALES', 'SALES'[STORE] ),
            SALES[YEAR] = yr
                &amp;amp;&amp;amp; SALES[WEEK] &amp;lt;= wk
                &amp;amp;&amp;amp; SALES[MONTH] &amp;lt;= mn
        )
    )
RETURN
    IF (
        ISFILTERED ( 'slicert'[MONTH] ) &amp;amp;&amp;amp; ISFILTERED ( 'slicert'[WEEK] )
            &amp;amp;&amp;amp; ISFILTERED ( 'slicert'[YEAR] ),
        sales_ytd,
        SUM ( 'SALES'[SALES] )
    )
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;4.Here's my final result, which I hope meets your requirements.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;5.&lt;/SPAN&gt;&lt;SPAN&gt;Below are posts similar to your issue that might be helpful to you:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Total-Revenue-YTD-for-ALL-years/td-p/4071979" target="_blank"&gt;&lt;SPAN&gt;Solved: Total Revenue YTD for ALL years - Microsoft Fabric Community&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;help&lt;/STRONG&gt;&lt;/EM&gt;s&lt;/SPAN&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P style="margin: 0in; line-height: 13pt; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 02:44:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-09T02:44:21Z</dc:date>
    <item>
      <title>YTD/ LTM show correct total but row values missing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4317409#M171421</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to show YTD/ LTM sales at Store level in a table, however, I am getting correct totals but some rows are missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets say I select week49, only the stores in week49 will show as individual rows but total will show correct number.&lt;/P&gt;&lt;P&gt;How can I show all the stores selling in YTD time period and not just the selected week? (Example below)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a measure to calculate YTD as follows:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;test_ytd =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;yr&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SALES&lt;/SPAN&gt;&lt;SPAN&gt;[YEAR]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;var mn = SELECTEDVALUE(SALES[MONTH])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;var wk = SELECTEDVALUE(SALES[WEEK])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;var sales_ytd = CALCULATE( &amp;nbsp;CALCULATE( SUMX(SALES, SALES[sales])), SALES[YEAR] = yr, SALES[WEEK] &amp;lt;= wk, SALES[MONTH] &amp;lt;= mn )&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Dec 2024 17:03:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4317409#M171421</guid>
      <dc:creator>Dr_BB</dc:creator>
      <dc:date>2024-12-06T17:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: YTD/ LTM show correct total but row values missing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4317641#M171429</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="891594" data-lia-user-login="Dr_BB" class="lia-mention lia-mention-user"&gt;Dr_BB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To address your DAX question and show all stores with sales in the YTD time period (not just those active in the selected week), you can modify your approach by ensuring the filter context does not exclude stores that do not have sales in the selected week.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here's an improved DAX formula to achieve this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;test_ytd =
VAR yr = SELECTEDVALUE(SALES[YEAR])
VAR wk = SELECTEDVALUE(SALES[WEEK])
RETURN
    CALCULATE(
        SUM(SALES[sales]),
        ALL(SALES[WEEK]), // Ensures all weeks are considered
        SALES[YEAR] = yr,
        SALES[WEEK] &amp;lt;= wk
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;Explanation of the Changes:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;ALL(SALES[WEEK]): Removes the filter on the WEEK column so that all stores with sales in the YTD period are included in the calculation, regardless of the selected week.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Filters on Year and Week: Ensure the measure respects the selected year (SALES[YEAR] = yr) and calculates cumulative sales up to the selected week (SALES[WEEK] &amp;lt;= wk).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;This adjustment ensures that the table displays all stores that have contributed to YTD sales, even if they are not active in the currently selected week. Let me know if further clarifications or refinements are needed!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 23:04:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4317641#M171429</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-12-06T23:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: YTD/ LTM show correct total but row values missing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4318874#M171465</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from DataNinja777&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="891594" data-lia-user-login="Dr_BB" class="lia-mention lia-mention-user"&gt;Dr_BB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;I believe the reason only one row of data is displayed is due to the interaction between the slicer and your visualisation object. The slicer's data comes from the original data, so it directly filters the original data rather than the expected result.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;Here is my solution:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;My sample data is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;Firstly, create the following calculation table. Ensure that there is no relationship established between this calculation table and the original table:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;slicert = DISTINCT(ALLEXCEPT('SALES','SALES'[STORE],'SALES'[SALES]))&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;SPAN&gt;Secondly, use the newly created calculation table as the slicer:&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 style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;3.&lt;/SPAN&gt;&lt;SPAN&gt;Next, create the following measure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;test_ytd =
VAR yr =
    SELECTEDVALUE ( 'slicert'[YEAR] )
VAR mn =
    SELECTEDVALUE ( 'slicert'[MONTH] )
VAR wk =
    SELECTEDVALUE ( 'slicert'[WEEK] )
VAR sales_ytd =
    CALCULATE (
        SUM ( 'SALES'[SALES] ),
        FILTER (
            ALLEXCEPT ( 'SALES', 'SALES'[STORE] ),
            SALES[YEAR] = yr
                &amp;amp;&amp;amp; SALES[WEEK] &amp;lt;= wk
                &amp;amp;&amp;amp; SALES[MONTH] &amp;lt;= mn
        )
    )
RETURN
    IF (
        ISFILTERED ( 'slicert'[MONTH] ) &amp;amp;&amp;amp; ISFILTERED ( 'slicert'[WEEK] )
            &amp;amp;&amp;amp; ISFILTERED ( 'slicert'[YEAR] ),
        sales_ytd,
        SUM ( 'SALES'[SALES] )
    )
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;4.Here's my final result, which I hope meets your requirements.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;5.&lt;/SPAN&gt;&lt;SPAN&gt;Below are posts similar to your issue that might be helpful to you:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Total-Revenue-YTD-for-ALL-years/td-p/4071979" target="_blank"&gt;&lt;SPAN&gt;Solved: Total Revenue YTD for ALL years - Microsoft Fabric Community&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;help&lt;/STRONG&gt;&lt;/EM&gt;s&lt;/SPAN&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P style="margin: 0in; line-height: 13pt; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 02:44:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4318874#M171465</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-09T02:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: YTD/ LTM show correct total but row values missing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4319704#M171485</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks for the answer!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, this solution is not working since the data is getting filtered because of the slicer interaction.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 13:03:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4319704#M171485</guid>
      <dc:creator>Dr_BB</dc:creator>
      <dc:date>2024-12-09T13:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: YTD/ LTM show correct total but row values missing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4319709#M171487</link>
      <description>&lt;P&gt;&lt;EM&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Thanks a lot for your answer!&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;It is working for me. Just a small change in Step1 :&lt;/EM&gt;&lt;/P&gt;&lt;DIV&gt;&lt;EM&gt;SALES_DIST_DATE = SUMMARIZE(SALES, (SALES[YEAR]), (SALES[MONTH]), (SALES[WEEK])&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;I have more numeric columns in my fact table and more granularity columns as well. So the above code looked more efficient.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Note: Might reach out again in acse of any issue after end-to-end QC.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Dec 2024 13:07:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-LTM-show-correct-total-but-row-values-missing/m-p/4319709#M171487</guid>
      <dc:creator>Dr_BB</dc:creator>
      <dc:date>2024-12-09T13:07:35Z</dc:date>
    </item>
  </channel>
</rss>

