<?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 Dax measure to compare dates in different rows based on a measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-to-compare-dates-in-different-rows-based-on-a/m-p/838593#M6297</link>
    <description>&lt;P&gt;This is my first time posting, so bear with me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have the following two measures that calculate running totals. These running totals change based on the current filter context (Category) slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	Actual running total (Measure) = 
	CALCULATE(
	    SUM('Table1'[Actual]),
	    FILTER(
	        ALLSELECTED('Table1'[Date]),
	        ISONORAFTER('Table1'[Date], MAX('Table1'[Date]), DESC)
	    )
	)
	
	Baseline running total (Measure) = 
	CALCULATE(
	    SUM([Baseline]),
	    FILTER(
	        ALLSELECTED('Table1'[Date]),
	        ISONORAFTER('Table1'[Date], MAX('Table1'[Date]), DESC)
	    )
	)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a measure that identifies "Days Delay" for each row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each row I need to take the "Actual running total (Measure)", find the Max "Baseline running total (measure)" that is less than the "Actual running total (Measure)" and then compare the differences in dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's take row "05 January 2019" as an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Take &lt;FONT color="#000000"&gt;"Actual running total (Measure)"&lt;/FONT&gt; = &lt;FONT color="#008000"&gt;(8)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Find Max "Baseline running total (measure)" that is less than "Actual running total (Measure)" = &lt;FONT color="#FF6600"&gt;(5)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Get the corresponding date = &lt;FONT color="#FF6600"&gt;(03 January 2019)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Compare (Datediff) with original Row Date &lt;FONT color="#008000"&gt;(05 January 2019)&lt;/FONT&gt; = &lt;STRONG&gt;(-2)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The big challenge is that the solution needs to be dynamic i.e. if I change the "Category" slicer, the measures&amp;nbsp; need to recalculate and produce the relevant results based on the context of the slicer / filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any direction or help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 14:40:43 GMT</pubDate>
    <dc:creator>CNGK</dc:creator>
    <dc:date>2019-11-06T14:40:43Z</dc:date>
    <item>
      <title>Dax measure to compare dates in different rows based on a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-to-compare-dates-in-different-rows-based-on-a/m-p/838593#M6297</link>
      <description>&lt;P&gt;This is my first time posting, so bear with me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have the following two measures that calculate running totals. These running totals change based on the current filter context (Category) slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	Actual running total (Measure) = 
	CALCULATE(
	    SUM('Table1'[Actual]),
	    FILTER(
	        ALLSELECTED('Table1'[Date]),
	        ISONORAFTER('Table1'[Date], MAX('Table1'[Date]), DESC)
	    )
	)
	
	Baseline running total (Measure) = 
	CALCULATE(
	    SUM([Baseline]),
	    FILTER(
	        ALLSELECTED('Table1'[Date]),
	        ISONORAFTER('Table1'[Date], MAX('Table1'[Date]), DESC)
	    )
	)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a measure that identifies "Days Delay" for each row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each row I need to take the "Actual running total (Measure)", find the Max "Baseline running total (measure)" that is less than the "Actual running total (Measure)" and then compare the differences in dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's take row "05 January 2019" as an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Take &lt;FONT color="#000000"&gt;"Actual running total (Measure)"&lt;/FONT&gt; = &lt;FONT color="#008000"&gt;(8)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Find Max "Baseline running total (measure)" that is less than "Actual running total (Measure)" = &lt;FONT color="#FF6600"&gt;(5)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Get the corresponding date = &lt;FONT color="#FF6600"&gt;(03 January 2019)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Compare (Datediff) with original Row Date &lt;FONT color="#008000"&gt;(05 January 2019)&lt;/FONT&gt; = &lt;STRONG&gt;(-2)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The big challenge is that the solution needs to be dynamic i.e. if I change the "Category" slicer, the measures&amp;nbsp; need to recalculate and produce the relevant results based on the context of the slicer / filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any direction or help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:40:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-measure-to-compare-dates-in-different-rows-based-on-a/m-p/838593#M6297</guid>
      <dc:creator>CNGK</dc:creator>
      <dc:date>2019-11-06T14:40:43Z</dc:date>
    </item>
  </channel>
</rss>

