<?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 previous month based on selected month in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2247705#M53992</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Hi&lt;BR /&gt;Do you have a relationship between the date table and the data table?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 13:37:48 GMT</pubDate>
    <dc:creator>DimaMD</dc:creator>
    <dc:date>2021-12-20T13:37:48Z</dc:date>
    <item>
      <title>calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2240086#M53586</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;How can i get previous month data based on selected month in DAX query?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;tower value = feb 2020 data.&lt;BR /&gt;tower previous = previous month data (jan 2020).&lt;BR /&gt;&lt;BR /&gt;For example i selected feb 2020 and i want jan 2020 data also but cant figure out how to calculate in DAX.&lt;BR /&gt;Here my table for reference.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 10:49:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2240086#M53586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-15T10:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2240109#M53589</link>
      <description>&lt;P&gt;HI,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Try this measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
CALCULATE(
    SUM('Table'[Value]),PREVIOUSMONTH('Dates'[Date] ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;You also need a Calendar Table&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 11:20:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2240109#M53589</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2021-12-15T11:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2241325#M53672</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312820" data-lia-user-login="DimaMD" class="lia-mention lia-mention-user"&gt;DimaMD&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;i try that measure but the data dont show up&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 03:21:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2241325#M53672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-16T03:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2247016#M53966</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Month_m = MONTH('Table'[Month])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;MonthYear =
FORMAT('Table'[Month],"mmm")&amp;amp;" "&amp;amp;RIGHT('Table'[Month],2)&lt;/LI-CODE&gt;
&lt;P&gt;2. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Tower Previous =
VAR _MONTH=SELECTEDVALUE('Table'[MonthYear])
VAR _Attribute=SELECTEDVALUE('Table'[Attrubute])
var _last=MAXX(FILTER(ALL('Table'),'Table'[MonthYear]=_MONTH),'Table'[Month_m]) -1
return
CALCULATE(SUM('Table'[Tower Value]),FILTER(ALL('Table'),
'Table'[Month_m]=_last&amp;amp;&amp;amp;'Table'[Attrubute]=_Attribute&amp;amp;&amp;amp;'Table'[Category]=MAX('Table'[Category])))&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 07:55:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2247016#M53966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-20T07:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2247705#M53992</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Hi&lt;BR /&gt;Do you have a relationship between the date table and the data table?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 13:37:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2247705#M53992</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2021-12-20T13:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2270648#M55268</link>
      <description>&lt;P&gt;yes both table have relationship&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 02:11:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2270648#M55268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-07T02:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculate previous month based on selected month in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2276614#M55588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;thanks it work but when i put 2021 data it doesn't appear.&lt;BR /&gt;can u advice me what i need to do?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 04:16:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-previous-month-based-on-selected-month-in-DAX/m-p/2276614#M55588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-11T04:16:49Z</dc:date>
    </item>
  </channel>
</rss>

