<?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: Calculating sum of two measures, with different dependencies on slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897994#M151908</link>
    <description>&lt;P&gt;Completely different fields, set by other slicers in the report. Different departments, accounting groups, etc.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2024 08:49:31 GMT</pubDate>
    <dc:creator>oceanfree</dc:creator>
    <dc:date>2024-05-07T08:49:31Z</dc:date>
    <item>
      <title>Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897866#M151893</link>
      <description>&lt;P&gt;Hi community,&lt;BR /&gt;&lt;BR /&gt;I have the following issue.&lt;BR /&gt;&lt;BR /&gt;I am trying to update a report that is used to report on actual costs, budget cost and prognosis cost (based on selected months in a slicer).&lt;BR /&gt;&lt;BR /&gt;In other words, for 2024, let's say I have selected the following months in my slicer: Jan, Feb, Mar.&lt;BR /&gt;&lt;BR /&gt;Then actual cost would report the cost accumulated in Jan, Feb and Mar.&lt;BR /&gt;Budget cost would report on the budgeted cost for Jan, Feb and Mar.&lt;BR /&gt;&lt;BR /&gt;But the prognosis for the full year should calculate the following:&lt;BR /&gt;&lt;BR /&gt;Remaining budget cost for the year: Apr - Dec&lt;BR /&gt;Prognosis cost for the year = Actual cost (Jan-Mar) + Remaining budget cost (Apr - Dec)&lt;BR /&gt;&lt;BR /&gt;Both of these measures are placed in a matrix visual in the report. The visual containing these measures is disconnected from the slicer that selects dates. When the visual is not disconnected from the slicer, the dates are limited to the selected months in the slicer (Jan, Feb, Mar).&lt;BR /&gt;&lt;BR /&gt;How can I achieve what I want? Both measures used to calculate the prognosis are dependant on the "month slicer", but one should use the selected months, and the other should use the non-selected ones. From my understanding, the visual itself has to be independent of the slicer, so is it possible to have the measure calculations dependent on a slicer in the report?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Fredrik&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:09:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897866#M151893</guid>
      <dc:creator>oceanfree</dc:creator>
      <dc:date>2024-05-07T08:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897888#M151896</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738352" data-lia-user-login="oceanfree" class="lia-mention lia-mention-user"&gt;oceanfree&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Remaining Budget Cost = 
VAR __MaxMonth = MAX( 'Calendar'[MonthNumber] )    -- The maximum month selected from your slicer
RETURN
    CALCULATE( SUM( 'Fact'[Budget] )
    , FILTER( ALL( 'Calendar'[MonthNumber] ), 'Calendar'[MonthNumber] &amp;gt; __MaxMonth )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've made a few assumptions here:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You have a calendar dimension table with a MonthNumber column, e.g. 1 for Jan, 2 for Feb etc.&lt;/LI&gt;&lt;LI&gt;Your budget data is in a fact table. You'll need to rename this and the budget column accordingly in the DAX measure.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 07 May 2024 08:18:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897888#M151896</guid>
      <dc:creator>HikingBIKing</dc:creator>
      <dc:date>2024-05-07T08:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897924#M151899</link>
      <description>&lt;P&gt;Here are the tables that are relevant:&lt;BR /&gt;&lt;BR /&gt;'Time'[Month Name Current] is currently used to hold the slicer values.&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&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;</description>
      <pubDate>Tue, 07 May 2024 08:27:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897924#M151899</guid>
      <dc:creator>oceanfree</dc:creator>
      <dc:date>2024-05-07T08:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897953#M151902</link>
      <description>&lt;P&gt;Here's the DAX code amended according to your model:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Remaining Budget Cost = 
VAR __MaxMonth = MAX( 'Time'[Month] )    -- The month number related to the latest month selected from your slicer
RETURN
    CALCULATE( [M_BudgetAmount]
    , FILTER( ALL( 'Time'[Month] ), 'Time'[Month] &amp;gt; __MaxMonth )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:33:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897953#M151902</guid>
      <dc:creator>HikingBIKing</dc:creator>
      <dc:date>2024-05-07T08:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897977#M151904</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Does not seem to be working (assuming I should also change 'Calendar' in the latter part of your dax to 'Time'. No values appearing for the measure when added to the visual.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:44:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897977#M151904</guid>
      <dc:creator>oceanfree</dc:creator>
      <dc:date>2024-05-07T08:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897981#M151906</link>
      <description>&lt;P&gt;Yes that's correct. I did edit my code to change 'Calendar' to 'Time'.&lt;BR /&gt;&lt;BR /&gt;What values are you adding to the row section of your matrix visual? Is it months or a completely different field.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:45:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897981#M151906</guid>
      <dc:creator>HikingBIKing</dc:creator>
      <dc:date>2024-05-07T08:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897994#M151908</link>
      <description>&lt;P&gt;Completely different fields, set by other slicers in the report. Different departments, accounting groups, etc.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:49:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3897994#M151908</guid>
      <dc:creator>oceanfree</dc:creator>
      <dc:date>2024-05-07T08:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3907294#M152207</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738352" data-lia-user-login="oceanfree" class="lia-mention lia-mention-user"&gt;oceanfree&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please share some data(exclude &lt;STRONG&gt;sensitive data&lt;/STRONG&gt;) or create some sample data, so that we can help you better.&lt;/P&gt;
&lt;P&gt;It's better to provide some&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;A title="https://nam06.safelinks.protection.outlook.com/?url=https%3a%2f%2fcommunity.powerbi.com%2ft5%2fcommunity-blog%2fhow-to-provide-sample-data-in-the-power-bi-forum%2fba-p%2f963216&amp;amp;data=05%7c01%7cclaire.dong%40microsoft.com%7cada9149bd91546a8432508dacd31ef9b%" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;A title="https://nam06.safelinks.protection.outlook.com/?url=https%3a%2f%2fcommunity.powerbi.com%2ft5%2fcommunity-blog%2fhow-to-get-your-question-answered-quickly%2fba-p%2f38490&amp;amp;data=05%7c01%7cclaire.dong%40microsoft.com%7cada9149bd91546a8432508dacd31ef9b%7c72f988" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 05:27:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3907294#M152207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-10T05:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of two measures, with different dependencies on slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3907558#M152219</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I managed to figure out a solution to my problem, which turned out to be rather trivial.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;M_Remaining_BudgetAmount_Year =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;__MaxMonth&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Time'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[M_BudgetAmount]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Time'&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;'Time'&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__MaxMonth&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;'Time'&lt;/SPAN&gt;&lt;SPAN&gt;[Month]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__MaxMonth&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Which is practically what&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738380" data-lia-user-login="HikingBIKing" class="lia-mention lia-mention-user"&gt;HikingBIKing&lt;/a&gt;&amp;nbsp;replied earlier, just complementing it with a constraint on the year in question.&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks a lot for all help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 07:10:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-two-measures-with-different-dependencies-on/m-p/3907558#M152219</guid>
      <dc:creator>oceanfree</dc:creator>
      <dc:date>2024-05-10T07:10:57Z</dc:date>
    </item>
  </channel>
</rss>

