<?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 Previous Month without any date filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2117484#M48522</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a table like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;id name country&amp;nbsp; month year&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sales&lt;/P&gt;&lt;P&gt;2&amp;nbsp; dfd&amp;nbsp; &amp;nbsp; &amp;nbsp;zy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020&amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to calculate is month and previous month based on selected month and year and the same where I have to calculate which quarter is selected and get previous quarter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that I have no date, so I cant use any time intelligence functions either my measure overwrites all the other columns.&lt;/P&gt;&lt;P&gt;How can I calculate previous month or quarter based on the slicer if there is no date table ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 23:16:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-05T23:16:33Z</dc:date>
    <item>
      <title>Previous Month without any date filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2117484#M48522</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a table like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;id name country&amp;nbsp; month year&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sales&lt;/P&gt;&lt;P&gt;2&amp;nbsp; dfd&amp;nbsp; &amp;nbsp; &amp;nbsp;zy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020&amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to calculate is month and previous month based on selected month and year and the same where I have to calculate which quarter is selected and get previous quarter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that I have no date, so I cant use any time intelligence functions either my measure overwrites all the other columns.&lt;/P&gt;&lt;P&gt;How can I calculate previous month or quarter based on the slicer if there is no date table ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 23:16:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2117484#M48522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-05T23:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month without any date filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2117519#M48525</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be better if you add date table to your report. Can you add more details about the result you are looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this if you just want to find the Last month number:&lt;/P&gt;&lt;P&gt;Last Month =&amp;nbsp;&lt;BR /&gt;Var _Date =&lt;BR /&gt;selectedvalue(table[month])-1&lt;/P&gt;&lt;P&gt;and to find the quarter you can use&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/quarter-function-dax" target="_blank"&gt;QUARTER&lt;/A&gt; dax code, something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quarter=&lt;BR /&gt;Var _D = date(selectedvalue(table[year]),selectedvalue(table[month]),01)&lt;BR /&gt;return&lt;BR /&gt;&lt;SPAN&gt;QUARTER(_D&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Previous Quarter=&lt;BR /&gt;Var _D = date(selectedvalue(table[year]),selectedvalue(table[month]),01)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Var _3D =&amp;nbsp;DATEADD(_D,-3,month)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return&lt;BR /&gt;QUARTER(_3D)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 00:05:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2117519#M48525</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-06T00:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month without any date filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2118236#M48543</link>
      <description>&lt;P&gt;Hi, im not sure I can fully follow. The problem is that i cant use dateadd as I dont have any date in my table at all. I tried using previous quarter but this says the var _d is not the right one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want is the sum(sales) of the quarter that is selected in the slicer (which is quarter and year) and show previous quarter sales next to it based on which quarter and year is selected. The same for month, if a month and year are selected, to show sum(sales) of that and next to it previous month based on the selection filter&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 07:13:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2118236#M48543</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-06T07:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month without any date filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2118280#M48544</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I tried sth like SUM ( table[sales] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;, FILTER ( ALL('table'),'table'[QuarterYear]= MAX('table'[QuarterYear]) - 1 but this doesnt give the right values for previous quarter sales, but not sure why&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Oct 2021 07:40:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-without-any-date-filter/m-p/2118280#M48544</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-06T07:40:24Z</dc:date>
    </item>
  </channel>
</rss>

