<?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: How do I sum index on multiple dates? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3647815#M141276</link>
    <description>&lt;P&gt;Hi Sjoerdvn, it works! brilliant! thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and thank you,&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/652260" target="_self"&gt;&lt;SPAN class=""&gt;v-xuxinyi-msft&lt;/SPAN&gt;&lt;/A&gt;, for getting back.&lt;/P&gt;&lt;P&gt;Have a nice&amp;nbsp; day, both.&lt;/P&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;Jayjay0306&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2024 09:39:15 GMT</pubDate>
    <dc:creator>jayjay0306</dc:creator>
    <dc:date>2024-01-19T09:39:15Z</dc:date>
    <item>
      <title>How do I sum index on multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3643678#M141084</link>
      <description>&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;I hope you can help me with a complex DAX problem:&lt;/P&gt;&lt;P&gt;I have a report based on the following tables:&lt;/P&gt;&lt;P&gt;D_Customer&lt;/P&gt;&lt;P&gt;D_Date&amp;nbsp;&lt;/P&gt;&lt;P&gt;F_Sale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each customer has day-to-day sale in the table:&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now, some of the sales dates for each customer are "marked" for various reasons.&lt;/P&gt;&lt;P&gt;On these "marked" dates, I try to do the following:&lt;/P&gt;&lt;P&gt;on each marked date I want to&lt;/P&gt;&lt;P&gt;1) "Date mark - 14 (Sum)" =&amp;nbsp; sum the sales for 14 days prior to the marked date&lt;/P&gt;&lt;P&gt;2) "Date mark +14 (Sum)" = sum the sales for 14 days after the marked date&lt;/P&gt;&lt;P&gt;3) make an index % =&amp;nbsp; "Date mark + 14 (Sum)" / "Date mark - 14 (Sum)"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example (illustrated):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This I have managed with the following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Index % = 
 VAR MarkedDateToday= MAX('Calendar'[Marked_Date])
 VAR varReportDate = SELECTEDVALUE( 'Calendar'[date] )
 VAR Summinus14=
  CALCULATE(
        SUM( 'Sales'[Sales] ),
        FILTER(
            ALL( 'Calendar'[date] ),
            'Calendar'[date] &amp;gt;= varReportDate-14&amp;amp;&amp;amp;'Calendar'[date] &amp;lt; varReportDate
        )
    )
 VAR Sumplus14=
    CALCULATE(
        SUM( 'Sales'[Sales] ),
        FILTER(
            ALL( 'Calendar'[date] ),
            'Calendar'[date] &amp;lt;= varReportDate+14&amp;amp;&amp;amp;'Calendar'[date] &amp;gt; varReportDate
        )
    )
 VAR Index_calc=DIVIDE(Sumplus14,Summinus14)

 RETURN
 IFERROR(IF(MarkedDateToday,Index_calc,0),BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT - and here is my challange:&lt;/P&gt;&lt;P&gt;once I have calculated the&amp;nbsp;"Date mark + 14 (Sum)",&amp;nbsp;"Date mark - 14 (Sum)" and&amp;nbsp; Index%, I need to make the average Index% for all marked dates on each customer:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does it make sense?&lt;/P&gt;&lt;P&gt;my problem is: how do I sum the "index %"-calculation for all relevant "marked"-dates on for each customer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any input or suggestion will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;JayJay0306&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 14:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3643678#M141084</guid>
      <dc:creator>jayjay0306</dc:creator>
      <dc:date>2024-01-17T14:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I sum index on multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3645400#M141148</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="139186" data-lia-user-login="jayjay0306" class="lia-mention lia-mention-user"&gt;jayjay0306&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand your requirement, but according to your description, your data comes from three tables, I am not quite sure about the table structure of your three tables, can you provide me with this information? You can refer to the following link to provide the data:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Or show it as a screenshot or excel. Please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _Yuliax&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 08:49:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3645400#M141148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-18T08:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I sum index on multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3645695#M141160</link>
      <description>&lt;P&gt;untested, but try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AVERAGEX(
	CALCULATETABLE(VALUES('Calendar'[date]), ALLSELECTED('Calendar'[date]), 'Calendar'[Marked_Date]),
	VAR varReportDate = CALCULATE(MAX('Calendar'[date]))
	VAR Summinus14=
 	 CALCULATE(
        	SUM( 'Sales'[Sales] ),
        	FILTER(
        	    ALL( 'Calendar'[date] ),
        	    'Calendar'[date] &amp;gt;= varReportDate-14&amp;amp;&amp;amp;'Calendar'[date] &amp;lt; varReportDate
       	 	)
    	)
 	VAR Sumplus14=
    	CALCULATE(
        	SUM( 'Sales'[Sales] ),
        	FILTER(
            		ALL( 'Calendar'[date] ),
            		'Calendar'[date] &amp;lt;= varReportDate+14&amp;amp;&amp;amp;'Calendar'[date] &amp;gt; varReportDate
        	)
    	)
 	RETURN DIVIDE(Sumplus14,Summinus14)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Jan 2024 10:46:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3645695#M141160</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2024-01-18T10:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I sum index on multiple dates?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3647815#M141276</link>
      <description>&lt;P&gt;Hi Sjoerdvn, it works! brilliant! thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and thank you,&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/652260" target="_self"&gt;&lt;SPAN class=""&gt;v-xuxinyi-msft&lt;/SPAN&gt;&lt;/A&gt;, for getting back.&lt;/P&gt;&lt;P&gt;Have a nice&amp;nbsp; day, both.&lt;/P&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;Jayjay0306&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 09:39:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-do-I-sum-index-on-multiple-dates/m-p/3647815#M141276</guid>
      <dc:creator>jayjay0306</dc:creator>
      <dc:date>2024-01-19T09:39:15Z</dc:date>
    </item>
  </channel>
</rss>

