<?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: How to compare different years date in a single table and chart in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2918768#M95663</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for pointing out that option as a possible way to solve being able to display a comparison between the two years worth of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From looking at this I would need to have a date associated with each response for the measure to be able to function correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present the dataset does not include this nor are the two years worth of data combined in a single dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has potential though and will continue to explore this as the way to do what I want to do.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 12:56:01 GMT</pubDate>
    <dc:creator>thomsona</dc:creator>
    <dc:date>2022-11-21T12:56:01Z</dc:date>
    <item>
      <title>How to compare different years date in a single table and chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2909996#M95086</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a report from the responses to a travel survey and need to be able to compare results from last year against those for this year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifically I need to be able to show in one chart the changes in the amount of CO2 produced by various modes of transport from one year to the next.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tables for the journey data for both last year and this year with a measure that calculates the CO2 figure for the different modes of transport. The fields in both tables are the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment the results of the calculation run through the measure are shown as two separate graphs in the report whereas it would be visually better to have them as a single graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I combine the two years worth of data to show the different CO2 emissions for each mode of transport as a single graph?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the survey that gathers the journey data is run ever year it would be good to be able to understand how to do this so that the changes over a longer period of time can also be shown if required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with this would be most welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2909996#M95086</guid>
      <dc:creator>thomsona</dc:creator>
      <dc:date>2022-11-16T15:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare different years date in a single table and chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2910907#M95118</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="306397" data-lia-user-login="thomsona" class="lia-mention lia-mention-user"&gt;thomsona&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;You should be able to do this using a measure with&amp;nbsp;SAMEPERIODLASTYEAR &lt;A href="https://learn.microsoft.com/en-us/dax/sameperiodlastyear-function-dax" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/sameperiodlastyear-function-dax&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 23:28:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2910907#M95118</guid>
      <dc:creator>djurecic</dc:creator>
      <dc:date>2022-11-16T23:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare different years date in a single table and chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2911444#M95146</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;Supposing you have a measure named [CO2Emission], t&lt;SPAN&gt;&lt;SPAN&gt;hen you can create a new measure for the emission in previous year like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;CO2EmissionPY =&amp;nbsp;&lt;DIV&gt;CALCULATE(&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; [CO2Emission&lt;SPAN&gt;],&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; DATEADD('Date'[Date], -1, YEAR)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;the trick is the number -1, which means 1 year ago. If you change it to -2, then the result is previous previous year.&amp;nbsp;&lt;DIV&gt;BTW, DATEADD is intelligence function, you would need a Date table.&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Nov 2022 05:22:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2911444#M95146</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-17T05:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare different years date in a single table and chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2918746#M95661</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for the suggested way forwards on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two measures (CO2 2021 and CO2 2022) which run the calculation for the respective year as the survey responses are not held in a single spreadsheet but rather in two seperate spreadsheets which I have not combined into a single dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what you have suggested this would work if the responses were in a single dataset and had a year identifier associated with each response (i.e. 2021 and 2022)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;It would not be difficult to set up a Date table as this can be expanded to include each your that the survey is run.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 12:45:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2918746#M95661</guid>
      <dc:creator>thomsona</dc:creator>
      <dc:date>2022-11-21T12:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare different years date in a single table and chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2918768#M95663</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for pointing out that option as a possible way to solve being able to display a comparison between the two years worth of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From looking at this I would need to have a date associated with each response for the measure to be able to function correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present the dataset does not include this nor are the two years worth of data combined in a single dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has potential though and will continue to explore this as the way to do what I want to do.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 12:56:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-different-years-date-in-a-single-table-and-chart/m-p/2918768#M95663</guid>
      <dc:creator>thomsona</dc:creator>
      <dc:date>2022-11-21T12:56:01Z</dc:date>
    </item>
  </channel>
</rss>

