<?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: Show value for all months for previous years by default with current year values on graph in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396148#M62529</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you make your axis based on Year-Month?&lt;/P&gt;&lt;P&gt;If you put a calculated column in your date table: example with Dates as table name and Date as a coulmn in the date table.&lt;/P&gt;&lt;P&gt;Year-Month CC = FORMAT(Dates[Date], "yyyy-mmm")&amp;nbsp; &amp;nbsp;or&amp;nbsp; &amp;nbsp;"yyyymm")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't have any other filter on your visual this would work. Hope this helps!&lt;/P&gt;</description>
    <pubDate>Tue, 15 Mar 2022 18:52:06 GMT</pubDate>
    <dc:creator>Whitewater100</dc:creator>
    <dc:date>2022-03-15T18:52:06Z</dc:date>
    <item>
      <title>Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396113#M62528</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to show values for all months for prior/previous years with the data for current year based on a year slicer. The issue is that the x-axis range always gets dictated&amp;nbsp; by the most up-to-date values (for the current year). See first screenshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several versions of previous year measures based on DAX (using DATEADD/PARALLEL PERIOD, ALLEXCEPT and ALL SELECTED) but cannot make it to show all months for previous years.&lt;BR /&gt;&lt;BR /&gt;Desired output shoud have all the values from 2021 (black line on second image) with the current values for 2022 (black line on first image).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 18:24:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396113#M62528</guid>
      <dc:creator>mfikram</dc:creator>
      <dc:date>2022-03-15T18:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396148#M62529</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you make your axis based on Year-Month?&lt;/P&gt;&lt;P&gt;If you put a calculated column in your date table: example with Dates as table name and Date as a coulmn in the date table.&lt;/P&gt;&lt;P&gt;Year-Month CC = FORMAT(Dates[Date], "yyyy-mmm")&amp;nbsp; &amp;nbsp;or&amp;nbsp; &amp;nbsp;"yyyymm")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't have any other filter on your visual this would work. Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 18:52:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396148#M62529</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-15T18:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396169#M62530</link>
      <description>&lt;P&gt;Is this what you are saying? Doesn't seem to work at my end&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 19:14:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396169#M62530</guid>
      <dc:creator>mfikram</dc:creator>
      <dc:date>2022-03-15T19:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396253#M62538</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;Here's a screenshot,just using one measure. You can drag your YEAR column into the Filter panel and have 2021 and 2022. The one below I checked off the months I wanted to show how the chart can go over two years or more.&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;</description>
      <pubDate>Tue, 15 Mar 2022 20:30:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2396253#M62538</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-15T20:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2398426#M62642</link>
      <description>&lt;P&gt;Thanks,&lt;BR /&gt;That makes sense.....however I am interested in showing the graphs as 2 separate trends to show a year over year trend.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 14:41:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2398426#M62642</guid>
      <dc:creator>mfikram</dc:creator>
      <dc:date>2022-03-16T14:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2398630#M62648</link>
      <description>&lt;P&gt;Can you add final ) on measure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:41:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2398630#M62648</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-16T15:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2398645#M62649</link>
      <description>&lt;P&gt;OK then all you would do is make a measure for LY and add it to the Values section in the field well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;usually the calculation for LY can be&lt;/P&gt;&lt;P&gt;&amp;nbsp; LY = CALCULATE[your measure like Sales you have for thi year], DATEADD(Dates[Date]), -1, YEAR))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume you have Date table named DATES and a Date Column named Date and this column has been marked as a Date Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:46:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2398645#M62649</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-16T15:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Show value for all months for previous years by default with current year values on graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2406395#M63195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223686" data-lia-user-login="mfikram" class="lia-mention lia-mention-user"&gt;mfikram&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I reproduce your problem. As there're only&amp;nbsp;January and Febrary in the year 2021, so when you select 2021 in the slicer, the value of current year only contain January and Febrary, and now the measure previous value will only contain&amp;nbsp;January and Febrary.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here's my solution.&lt;/P&gt;
&lt;P&gt;1.Create aonther month table, which has no relationship with the fact table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Month = GENERATESERIES(1,12)&lt;/LI-CODE&gt;
&lt;P&gt;2.Create two measures for the value of current year an previous year.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales =
CALCULATE (
    MAX ( 'Table'[Sales] ),
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Month] = MAX ( 'Month'[Month] ) )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Pre-sales' =
CALCULATE (
    MAX ( 'Table'[Sales] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Year]
            = MAX ( 'Table'[Year] ) - 1
            &amp;amp;&amp;amp; 'Table'[Month] = MAX ( 'Month'[Month] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the correct result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:19:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-for-all-months-for-previous-years-by-default-with/m-p/2406395#M63195</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-03-21T10:19:31Z</dc:date>
    </item>
  </channel>
</rss>

