<?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 Chart Granularity in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262208#M168931</link>
    <description>&lt;P&gt;I have a graph that shows the Offered, Answered &amp;amp; Abandoned calls from my data set. I have this on the y-axis of a bar chart and then I have created a parameter for the dates on the x-axis. This allows me to use a slicer to swap between the granularity levels (Daily, Weekly, Monthly).To achieve this, I have a date table that has all the dates for this year, along with a column defining the month and a column defining the week commencing date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the Daily view to show the last 30 days, the weekly view to show the last 8 weeks and the monthly view to show the last 12 months. This is where I am running into an issue. I can't get the dates to change with the granularity which causes my data to show an entire year of data on all the views.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I change this so the date range of the displayed data aligns with the desired granularity that is being set by the slicer?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2024 12:01:42 GMT</pubDate>
    <dc:creator>Diabetic</dc:creator>
    <dc:date>2024-10-29T12:01:42Z</dc:date>
    <item>
      <title>Chart Granularity</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262208#M168931</link>
      <description>&lt;P&gt;I have a graph that shows the Offered, Answered &amp;amp; Abandoned calls from my data set. I have this on the y-axis of a bar chart and then I have created a parameter for the dates on the x-axis. This allows me to use a slicer to swap between the granularity levels (Daily, Weekly, Monthly).To achieve this, I have a date table that has all the dates for this year, along with a column defining the month and a column defining the week commencing date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the Daily view to show the last 30 days, the weekly view to show the last 8 weeks and the monthly view to show the last 12 months. This is where I am running into an issue. I can't get the dates to change with the granularity which causes my data to show an entire year of data on all the views.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I change this so the date range of the displayed data aligns with the desired granularity that is being set by the slicer?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 12:01:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262208#M168931</guid>
      <dc:creator>Diabetic</dc:creator>
      <dc:date>2024-10-29T12:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Granularity</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262474#M168943</link>
      <description>&lt;P&gt;You can try creating a measure which you would use in the filter pane, set to only show when the value is 1.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Filter Measure =
VAR FirstVisibleDate =
    MIN ( 'Date'[Date] )
VAR LastVisibleDate =
    MAX ( 'Date'[Date] )
VAR LastDateToShow =
    TODAY ()
VAR __SelectedGranularity =
    SELECTCOLUMNS (
        SUMMARIZE ( Parameter, Parameter[Parameter], Parameter[Parameter Fields] ),
        Parameter[Parameter]
    )
VAR FirstDateToShow =
    IF (
        COUNTROWS ( __SelectedGranularity ) = 1,
        SWITCH (
            __SelectedValue,
            "Daily", LastDateToShow - 30,
            "Monthly", EOMONTH ( LastDateToShow, -13 ) + 1,
            "Weekly",
                LOOKUPVALUE ( 'Date'[Week commencing], 'Date'[Date], LastDateToShow - 7 * 8 )
        )
    )
VAR Result =
    IF (
        FirstVisibleDate &amp;gt;= FirstDateToShow
            &amp;amp;&amp;amp; LastVisibleDate &amp;lt;= LastDateToShow,
        1
    )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Oct 2024 14:20:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262474#M168943</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-10-29T14:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Granularity</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262633#M168949</link>
      <description>&lt;P&gt;Excellent, that worked brilliantly. Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 16:05:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Chart-Granularity/m-p/4262633#M168949</guid>
      <dc:creator>Diabetic</dc:creator>
      <dc:date>2024-10-29T16:05:53Z</dc:date>
    </item>
  </channel>
</rss>

