<?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: Creating a Measure to Compare Aggregated Values Across Different Date Filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4725697#M181016</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To handle such scenarios, you can create one date table and create one active and multiple inactive relationships between the date dimension and fact table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In your DAX measures, if you want to calculate based on active filter then you do not to modify the context, it is required only when you want to calcualte based on inactive relationship, for example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Orders = COUNTROWS(Sales)


Orders Shipped =
CALCULATE(
    COUNTROWS(Sales)
    ,USERELATIONSHIP('Date'[Date], Sales[ShipDate])
)&lt;/LI-CODE&gt;
&lt;P&gt;If you want to create. a third measure, then you can do it easily&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Difference = [Orders] - [Orders Shipped]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;follow this documet for more details&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/relationships-active-inactive" target="_blank"&gt;https://learn.microsoft.com/en-us/power-bi/guidance/relationships-active-inactive&lt;/A&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connect on &lt;A href="https://www.linkedin.com/in/tharun-kumar-ravikrindhi/" target="_blank" rel="noopener"&gt;LinkedIn&lt;/A&gt;&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;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV style="border-radius: 1px; padding: 10px; border: solid #cccccc 1px; background: #fafafa no-repeat right 10px center;"&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;If I helped you, click on the Thumbs Up to give Kudos.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;
&lt;P style="padding: 0; margin: 5px 50px 0 0;"&gt;Proud to be a Super User!&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 09 Jun 2025 12:08:17 GMT</pubDate>
    <dc:creator>tharunkumarRTK</dc:creator>
    <dc:date>2025-06-09T12:08:17Z</dc:date>
    <item>
      <title>Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4725624#M181009</link>
      <description>&lt;P&gt;I'm working with two separate measures in Power BI, each calculating the sum of the same calculated column. However, each measure is filtered by a different date table to allow for time-based comparisons. I attempted to create a third measure that subtracts one from the other, but the result always returns zero. It seems that the context of the date filters is causing the measures to cancel each other out. I'm looking for a way to correctly compute the difference between these two measures while preserving their individual date contexts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 11:46:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4725624#M181009</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-09T11:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4725697#M181016</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To handle such scenarios, you can create one date table and create one active and multiple inactive relationships between the date dimension and fact table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In your DAX measures, if you want to calculate based on active filter then you do not to modify the context, it is required only when you want to calcualte based on inactive relationship, for example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Orders = COUNTROWS(Sales)


Orders Shipped =
CALCULATE(
    COUNTROWS(Sales)
    ,USERELATIONSHIP('Date'[Date], Sales[ShipDate])
)&lt;/LI-CODE&gt;
&lt;P&gt;If you want to create. a third measure, then you can do it easily&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Difference = [Orders] - [Orders Shipped]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;follow this documet for more details&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/relationships-active-inactive" target="_blank"&gt;https://learn.microsoft.com/en-us/power-bi/guidance/relationships-active-inactive&lt;/A&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connect on &lt;A href="https://www.linkedin.com/in/tharun-kumar-ravikrindhi/" target="_blank" rel="noopener"&gt;LinkedIn&lt;/A&gt;&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;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV style="border-radius: 1px; padding: 10px; border: solid #cccccc 1px; background: #fafafa no-repeat right 10px center;"&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;If I helped you, click on the Thumbs Up to give Kudos.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;
&lt;P style="padding: 0; margin: 5px 50px 0 0;"&gt;Proud to be a Super User!&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Jun 2025 12:08:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4725697#M181016</guid>
      <dc:creator>tharunkumarRTK</dc:creator>
      <dc:date>2025-06-09T12:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4726735#M181059</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;To compare aggregated values across different date filters in Power BI, set up a single date table and connect it to your fact table with one active and one or more inactive relationships. In your DAX measures, use the USERELATIONSHIP() function to activate the appropriate relationship when needed.&lt;/SPAN&gt;&lt;/H3&gt;&lt;DIV class=""&gt;&lt;P&gt;For example, calculate one value using the active relationship, and for the other, use CALCULATE with USERELATIONSHIP to reference the inactive date relationship. Then, create your third measure by subtracting the two results. This method ensures each measure keeps its own date filter context, so your comparison works as intended.&lt;/P&gt;&lt;P&gt;If you want a step-by-step sample DAX or guidance for your exact model, just let me know.&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;SPAN&gt;translation and formatting supported by AI&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Jul 2025 08:52:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4726735#M181059</guid>
      <dc:creator>burakkaragoz</dc:creator>
      <dc:date>2025-07-01T08:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4727043#M181072</link>
      <description>&lt;P&gt;So im not sure what im doing wrong, I have one date table (dates) which connected to a column named date in payroll table, than I created an Inactive vetween the date table th a column named "inactive dates" at the same payroll table,&lt;/P&gt;&lt;P&gt;than I created 2 measuers, one is sum of a column and created filters with the active relationship,&lt;/P&gt;&lt;P&gt;than a second measure&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sum Scenario &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Payroll table'&lt;/SPAN&gt;&lt;SPAN&gt;[Apr POR]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Dates&lt;/SPAN&gt;&lt;SPAN&gt;[date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Payroll table'&lt;/SPAN&gt;&lt;SPAN&gt;[Date inactive]&lt;/SPAN&gt;&lt;SPAN&gt;)) is getting zero&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;than I created another measure to subtract the other 2 but its not working, any ideas ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;</description>
      <pubDate>Tue, 10 Jun 2025 10:57:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4727043#M181072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-10T10:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4727144#M181075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for reaching out to the Microsoft fabric community forum. Also thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="529075" data-lia-user-login="burakkaragoz" class="lia-mention lia-mention-user"&gt;burakkaragoz&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="685422" data-lia-user-login="tharunkumarRTK" class="lia-mention lia-mention-user"&gt;tharunkumarRTK&lt;/a&gt;,&amp;nbsp; for those valuable insights for this thread.&lt;BR /&gt;&lt;BR /&gt;After thoroughly reviewing the details you provided, I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.&lt;BR /&gt;&lt;BR /&gt;outcome:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I am also including .pbix file for your better understanding, please have a look into it:&lt;BR /&gt;&lt;BR /&gt;If this post&amp;nbsp;helps, then please give us ‘Kudos’ and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;&lt;BR /&gt;Thank you for using Microsoft Community Forum.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 12:03:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4727144#M181075</guid>
      <dc:creator>v-kpoloju-msft</dc:creator>
      <dc:date>2025-06-10T12:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4730962#M181222</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 05:04:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4730962#M181222</guid>
      <dc:creator>v-kpoloju-msft</dc:creator>
      <dc:date>2025-06-13T05:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to Compare Aggregated Values Across Different Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4733906#M181335</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;BR /&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 17:17:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-Compare-Aggregated-Values-Across-Different/m-p/4733906#M181335</guid>
      <dc:creator>v-kpoloju-msft</dc:creator>
      <dc:date>2025-06-16T17:17:17Z</dc:date>
    </item>
  </channel>
</rss>

