<?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 Need to display rolling 6 months data in each month bar. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1933721#M42024</link>
    <description>&lt;P&gt;Hi There, I have learnt a lot from the community. Thanks for that first. This is my first post &amp;amp; I have a query.&lt;BR /&gt;&lt;BR /&gt;I have a bar chart which displays each month total. [Count of users]&lt;BR /&gt;My date filters are from the same table (its a Date Range with slider).&lt;BR /&gt;I need to show rolling 6 months data in each month bar.&lt;BR /&gt;Eg. If i select a date range in the filter (01-01-2021 to 30-06-2021) the following is expected&lt;BR /&gt;June 2021 bar should display Jan 2021 to May 2021 aggreagate data , and&lt;BR /&gt;May 2021 data bar should display December 2020 to April 2021 show&amp;nbsp;aggreagate data and so on.&lt;BR /&gt;Every month bar should have the previous 6 months data in it.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have tried writing a measure as follows&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;010 Moving Month = IFERROR(CALCULATE(DISTINCTCOUNTNOBLANK(Append2[USER_EMAIL]),DATESINPERIOD(Append2[Date(Key1)].[Date],LASTDATE(Append2[Date(Key1)].[Date]),-6,MONTH))+0,0)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;When i add this measure to the column value it displays zero.&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;If i display this measure in a card and use the date filter as dropdown and select particular month and year this displays the last 6 months values from June 2021&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Note: I am a beginner&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 17:09:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-01T17:09:42Z</dc:date>
    <item>
      <title>Need to display rolling 6 months data in each month bar.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1933721#M42024</link>
      <description>&lt;P&gt;Hi There, I have learnt a lot from the community. Thanks for that first. This is my first post &amp;amp; I have a query.&lt;BR /&gt;&lt;BR /&gt;I have a bar chart which displays each month total. [Count of users]&lt;BR /&gt;My date filters are from the same table (its a Date Range with slider).&lt;BR /&gt;I need to show rolling 6 months data in each month bar.&lt;BR /&gt;Eg. If i select a date range in the filter (01-01-2021 to 30-06-2021) the following is expected&lt;BR /&gt;June 2021 bar should display Jan 2021 to May 2021 aggreagate data , and&lt;BR /&gt;May 2021 data bar should display December 2020 to April 2021 show&amp;nbsp;aggreagate data and so on.&lt;BR /&gt;Every month bar should have the previous 6 months data in it.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have tried writing a measure as follows&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;010 Moving Month = IFERROR(CALCULATE(DISTINCTCOUNTNOBLANK(Append2[USER_EMAIL]),DATESINPERIOD(Append2[Date(Key1)].[Date],LASTDATE(Append2[Date(Key1)].[Date]),-6,MONTH))+0,0)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;When i add this measure to the column value it displays zero.&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;If i display this measure in a card and use the date filter as dropdown and select particular month and year this displays the last 6 months values from June 2021&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Note: I am a beginner&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 17:09:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1933721#M42024</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-01T17:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display rolling 6 months data in each month bar.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1933914#M42043</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// First of all, a correct model in PBI
// NEVER uses the auto-generated date
// tables and date/time hierarchies. They
// are---simply put---wrong. That's the first thing.
// Second, in a good model, one where
// there's a proper Date table as outlined
// in, say, https://dax.guide/dateadd, you
// can write:

[User Count 6M-Sum] =
// Grab the last date visible in the
// current context
var LastVisibleDate = MAX( Dates[Date] )
// Create a new filter on Dates
// that spans a period of 6 months
// which ends on the LastVisibleDate.
var NewDateFilter =
    DATESINPERIOD(
        Dates[Date],
        LastVisibleDate,
        -6, MONTH
    )
var Result =
// Apply the new filter and remove
// all original filters from Dates.
    CALCULATE(
        [User Count],
        NewDateFilter,
        REMOVEFILTERS( Dates )
    )
return
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Jul 2021 20:46:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1933914#M42043</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-07-01T20:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display rolling 6 months data in each month bar.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1934430#M42054</link>
      <description>&lt;P&gt;Thank a lot. That worked prefectly.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 06:10:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-display-rolling-6-months-data-in-each-month-bar/m-p/1934430#M42054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-02T06:10:57Z</dc:date>
    </item>
  </channel>
</rss>

