<?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: Replacing Quarter label by selected period in X axis Graph in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2566824#M73159</link>
    <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an interesting one!&lt;/P&gt;
&lt;P&gt;It seems to be one of those problems that's easier to describe than to solve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached a dummy PBIX with some ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's late here, but my initial idea is that you would need to modify your data model and measures to get this to work:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a special table that contains a row for every possible "partial quarter". Let's call this &lt;STRONG&gt;'Quarter Extended'&lt;/STRONG&gt;, screenshot below. It includes columns Quarter, Min Month, Max Month and Label, with Label being "Jan-Feb' etc.&lt;/LI&gt;
&lt;LI&gt;Relate this to your &lt;STRONG&gt;'Date'&lt;/STRONG&gt; table via an intermediate &lt;STRONG&gt;'Quarter'&lt;/STRONG&gt; table containing the Quarters 1 to 4. The relationship between &lt;STRONG&gt;'Quarter Extended'&lt;/STRONG&gt; and &lt;STRONG&gt;'Quarter'&lt;/STRONG&gt; is bidirectional.&lt;/LI&gt;
&lt;LI&gt;Create a helper measure called Display Flag, that return TRUE if the particular Label should be displayed (see below).&lt;/LI&gt;
&lt;LI&gt;Modify existing measures (or use a calculation group) to only display measures when Display Flag = TRUE.&lt;/LI&gt;
&lt;LI&gt;Create visuals using 'Quarter Extended'[Label] on the axis and the modified measures.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Quarter Extended&lt;/STRONG&gt; table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Model:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Display Flag measure&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Display Flag = 
VAR QuarterMinMonthSelected =
    CALCULATE (
        MIN ( 'Date'[Month] ),
        VALUES ( 'Date'[Year-Quarter] ),
        ALLSELECTED ( 'Date' )
    )
VAR QuarterMaxMonthSelected =
    CALCULATE (
        MAX ( 'Date'[Month] ),
        VALUES ( 'Date'[Year-Quarter] ),
        ALLSELECTED ( 'Date' )
    )
VAR DisplayFlag =
    CALCULATE (
        NOT ISEMPTY ( 'Quarter Extended' ),
        KEEPFILTERS ( 'Quarter Extended'[Min Month] = QuarterMinMonthSelected ),
        KEEPFILTERS ( 'Quarter Extended'[Max Month] = QuarterMaxMonthSelected )
    )
RETURN
    DisplayFlag&lt;/LI-CODE&gt;
&lt;P&gt;Having done all this, you can filter on any range of months, and see the appropriate partial quarter labels on the axis of a visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;This may well need refining, but I think the general idea of the 'Quarter Extended' table is probably the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 14:14:29 GMT</pubDate>
    <dc:creator>OwenAuger</dc:creator>
    <dc:date>2022-06-08T14:14:29Z</dc:date>
    <item>
      <title>Replacing Quarter label by selected period in X axis Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2566305#M73136</link>
      <description>&lt;P&gt;Hey team,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do what it seems to be silly but i think it's not&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a graph showed by Quarter "Q1, Q2,..." and i would like to change it:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of showing "Q1" i would like to show the month range for this quarter based on what the user selected in the date slicer.&lt;BR /&gt;Example 1: If the user selects the whole year, my bar graph would show 4 bars with the following labels (labels showing the month ranges for each quarter):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it needs to be dynamic, so..&lt;BR /&gt;Example 2:&amp;nbsp; User selected &lt;STRONG&gt;February&lt;/STRONG&gt; untill &lt;STRONG&gt;August&lt;/STRONG&gt; on the dates slicer - I would like to see on the graph:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Basically i'm trying to group my data and avoid confusion with the users, so they won't think that Q1 contains data for all the Q1 months..&lt;BR /&gt;&lt;BR /&gt;Is that a way to do what i want?&lt;BR /&gt;&lt;BR /&gt;thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 10:40:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2566305#M73136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-08T10:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing Quarter label by selected period in X axis Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2566824#M73159</link>
      <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an interesting one!&lt;/P&gt;
&lt;P&gt;It seems to be one of those problems that's easier to describe than to solve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached a dummy PBIX with some ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's late here, but my initial idea is that you would need to modify your data model and measures to get this to work:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a special table that contains a row for every possible "partial quarter". Let's call this &lt;STRONG&gt;'Quarter Extended'&lt;/STRONG&gt;, screenshot below. It includes columns Quarter, Min Month, Max Month and Label, with Label being "Jan-Feb' etc.&lt;/LI&gt;
&lt;LI&gt;Relate this to your &lt;STRONG&gt;'Date'&lt;/STRONG&gt; table via an intermediate &lt;STRONG&gt;'Quarter'&lt;/STRONG&gt; table containing the Quarters 1 to 4. The relationship between &lt;STRONG&gt;'Quarter Extended'&lt;/STRONG&gt; and &lt;STRONG&gt;'Quarter'&lt;/STRONG&gt; is bidirectional.&lt;/LI&gt;
&lt;LI&gt;Create a helper measure called Display Flag, that return TRUE if the particular Label should be displayed (see below).&lt;/LI&gt;
&lt;LI&gt;Modify existing measures (or use a calculation group) to only display measures when Display Flag = TRUE.&lt;/LI&gt;
&lt;LI&gt;Create visuals using 'Quarter Extended'[Label] on the axis and the modified measures.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Quarter Extended&lt;/STRONG&gt; table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Model:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Display Flag measure&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Display Flag = 
VAR QuarterMinMonthSelected =
    CALCULATE (
        MIN ( 'Date'[Month] ),
        VALUES ( 'Date'[Year-Quarter] ),
        ALLSELECTED ( 'Date' )
    )
VAR QuarterMaxMonthSelected =
    CALCULATE (
        MAX ( 'Date'[Month] ),
        VALUES ( 'Date'[Year-Quarter] ),
        ALLSELECTED ( 'Date' )
    )
VAR DisplayFlag =
    CALCULATE (
        NOT ISEMPTY ( 'Quarter Extended' ),
        KEEPFILTERS ( 'Quarter Extended'[Min Month] = QuarterMinMonthSelected ),
        KEEPFILTERS ( 'Quarter Extended'[Max Month] = QuarterMaxMonthSelected )
    )
RETURN
    DisplayFlag&lt;/LI-CODE&gt;
&lt;P&gt;Having done all this, you can filter on any range of months, and see the appropriate partial quarter labels on the axis of a visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;This may well need refining, but I think the general idea of the 'Quarter Extended' table is probably the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 14:14:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2566824#M73159</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2022-06-08T14:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing Quarter label by selected period in X axis Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2568831#M73278</link>
      <description>&lt;P&gt;thank you Owen for your hard work on this!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try it here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:10:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Replacing-Quarter-label-by-selected-period-in-X-axis-Graph/m-p/2568831#M73278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-09T10:10:12Z</dc:date>
    </item>
  </channel>
</rss>

