<?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: calculate value between two chosen filtered months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722259#M83065</link>
    <description>&lt;P&gt;the reason why i have to use index for this is that i have missing months in between, so the previousmonth etc functions won't work&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 06:57:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-08-24T06:57:22Z</dc:date>
    <item>
      <title>calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720000#M82902</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a filter with 5 months values, lets say i have chosen 01.2022 and 03.2022.&lt;/P&gt;&lt;P&gt;i have an income column that contains income value for all dates within each month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i need to sum up income for all days in 01.2022 and 03.2022 and calculate the difference between the two months, i.e. income for max month - income for min month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;this should work with whatever 2 months i choose in the filter.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have googled and couldn't find any solutions to this problem.&lt;/P&gt;&lt;P&gt;is this even possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 10:59:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720000#M82902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-23T10:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720022#M82905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For this you can use the Date Filter to set Max Min Range of Dates. Follow the instructions from the link:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Kudos are also appreciated!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 11:10:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720022#M82905</guid>
      <dc:creator>bilalrana</dc:creator>
      <dc:date>2022-08-23T11:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720040#M82909</link>
      <description>&lt;P&gt;i can't see how that will solve my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a table visual with month and total_income and difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it should look like the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my problem is how to calculate the difference part, based on ANY chosen months in the filter.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 11:20:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720040#M82909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-23T11:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720457#M82937</link>
      <description>&lt;P&gt;H9&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Difference =
VAR SelectedMonths =
    ALLSELECTED ( TableName[Month] )
VAR MaxMonth =
    MAXX ( SelectedMonths, TableName[Month] )
VAR MinMonth =
    MINX ( SelectedMonths, TableName[Month] )
VAR MaxValue =
    CALCULATE ( [Income], TableName[Month] = MaxMonth )
VAR MinValue =
    CALCULATE ( [Income], TableName[Month] = MinMonth )
RETURN
    MaxValue - MinValue&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 13:42:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720457#M82937</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-23T13:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720758#M82958</link>
      <description>&lt;P&gt;that didn't work either &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what i have done so far which gets me a little on the way is the following:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Index = &lt;/SPAN&gt;&lt;SPAN&gt;RANKX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Prognosemodell_Prognose_Total_Test_Historikk&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Prognosemodell_Prognose_Total_Test_Historikk&lt;/SPAN&gt;&lt;SPAN&gt;[prognose_dato]&lt;/SPAN&gt;&lt;SPAN&gt;, , &lt;/SPAN&gt;&lt;SPAN&gt;ASC&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Dense&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e. i have created an index for the month, which means the last month has the highest index and the oldest months have index 1.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then i used this to pick up the value for the highest index chosen - 1, i.e. i can see the difference between the highest chosen index and the next on the list.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;inntekter forrige = &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; &lt;/SPAN&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;SPAN&gt;UM&lt;/SPAN&gt; &lt;SPAN&gt;( P&lt;/SPAN&gt;&lt;SPAN&gt;rognosemodell_Prognose_Total_Test_Historikk[&lt;/SPAN&gt;&lt;SPAN&gt;Inntekter] &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;SPAN&gt;FI&lt;/SPAN&gt;&lt;SPAN&gt;LTER&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;ALL&lt;/SPAN&gt;&lt;SPAN&gt;EXCEPT&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Pro&lt;/SPAN&gt;&lt;SPAN&gt;gnosemodell_Prognose_Total_Test_Historikk,da&lt;/SPAN&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;e_dim[Da&lt;/SPAN&gt;&lt;SPAN&gt;te] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Prog&lt;/SPAN&gt;&lt;SPAN&gt;nosemodell_Prognose_Total_Test_Historikk[Ind&lt;/SPAN&gt;&lt;SPAN&gt;ex]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt; Pr&lt;/SPAN&gt;&lt;SPAN&gt;ogn&lt;/SPAN&gt;&lt;SPAN&gt;osemodell_Prognose_Total_Test_Historikk[Inde&lt;/SPAN&gt;&lt;SPAN&gt;x] ) - &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;what would actually solve the problem is if i can set the -1 to the index of the min of the chosen months. any idea on how to do this?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Aug 2022 15:28:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2720758#M82958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-23T15:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722189#M83061</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can use Variables in the DAX Measures.&lt;BR /&gt;Helping Link:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/best-practices/dax-variables" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/best-practices/dax-variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As communicated by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, you can cater this scenario.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Kudos are also appreciated!&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 06:33:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722189#M83061</guid>
      <dc:creator>bilalrana</dc:creator>
      <dc:date>2022-08-24T06:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722259#M83065</link>
      <description>&lt;P&gt;the reason why i have to use index for this is that i have missing months in between, so the previousmonth etc functions won't work&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 06:57:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722259#M83065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-24T06:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722284#M83066</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;It depend on the filter context of the visual itself. I can see that all columns are from the same table. Not having dimention tables might be little tricky. The solution I have provided earlier (if the month column is a numeric value column) should work, however, depending on the existing&amp;nbsp;filter context, the filter of some columns might have to be removed. Please provide more context in order to support you further. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 07:02:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722284#M83066</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-24T07:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculate value between two chosen filtered months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722336#M83068</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Yes, but what does that have to do with finding the two selected months? Gaps are irrelevant&amp;nbsp;here.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 07:24:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-value-between-two-chosen-filtered-months/m-p/2722336#M83068</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-24T07:24:58Z</dc:date>
    </item>
  </channel>
</rss>

