<?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: Survey questions - change year on year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3001519#M101359</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="493772" data-lia-user-login="Fizzgig08" class="lia-mention lia-mention-user"&gt;Fizzgig08&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes it does! That is what this measure is doing, comparing if 2022's score has increased or improved compared to 2021&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;HasIncreased = 
if(SUM('Table 2'[CurrentTotalScore]) &amp;gt; sum('Table 2'[PreviousTotalScore]), 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you're on track with your report!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jewel&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2023 16:39:43 GMT</pubDate>
    <dc:creator>jewel_at</dc:creator>
    <dc:date>2023-01-04T16:39:43Z</dc:date>
    <item>
      <title>Survey questions - change year on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/2999282#M101209</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to Power BI and seeking help/guidance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a report using survey data. One of the visuals is a bar graph showing the score for each question in a particular survey section for 2022. My data also includes the score for the same questions in 2021 but I don't want this displayed in the visual so have filtered to only show data for 2022. I have set up my slicers, so I can filter by department and survey section to show the relevant questions and scores for the current year, and all works as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I would now like to use conditional formatting to show whether the score for each question has increased or decreased since 2021 through the colour of the bar (red for decrease, green for increase for example).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume I will need to create a new measure to achieve this, but I'm not sure. Guidance and help appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 19:00:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/2999282#M101209</guid>
      <dc:creator>Fizzgig08</dc:creator>
      <dc:date>2023-01-03T19:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Survey questions - change year on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/2999544#M101216</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="493772" data-lia-user-login="Fizzgig08" class="lia-mention lia-mention-user"&gt;Fizzgig08&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Do you mean that you have both 2021 and 2022 data in the same table? Like this?&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;If yes, then you can try to create a new table with DAX&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var CurrentTotal =
SUMMARIZE(CALCULATETABLE('Table', 'Table'[Year] = "2022"), 'Table'[Question], "CurrentTotalScore", SUM('Table'[Score]))

var PreviousTotal =
SUMMARIZE(CALCULATETABLE('Table', 'Table'[Year] = "2021"), 'Table'[Question], "PreviousTotalScore", SUM('Table'[Score]))

RETURN NATURALLEFTOUTERJOIN(CurrentTotal, PreviousTotal)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Then create a new calculated measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;HasIncreased = 
if(SUM('Table 2'[CurrentTotalScore]) &amp;gt; sum('Table 2'[PreviousTotalScore]), 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To apply the conditional formatting on your bar chart, go to the Visualization settings, and setup Rules on the conditional formatting&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;Since you have filters, you would have to add a relationship with the DAX table and original data table. Or just add those columns in the DAX table when you group it by, and change the filters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can donwload the sample here:&lt;/P&gt;&lt;P&gt;&lt;A title="Compare If Has Increased" href="https://1drv.ms/u/s!AOgdyzw9T9hOjSY" target="_self"&gt;Compare If Has Increased&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This might give you some idea.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps though!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jewel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 22:23:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/2999544#M101216</guid>
      <dc:creator>jewel_at</dc:creator>
      <dc:date>2023-01-03T22:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Survey questions - change year on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3000282#M101247</link>
      <description>&lt;P&gt;Yes that is what I mean!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I will give it a go today and see how I get on!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question - is your solution looking at the total score for 2021 vs the total score for 2022? I need it to look at question A, for example, and see whether question A's score improved or declined Year on Year, then the same for every question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 07:56:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3000282#M101247</guid>
      <dc:creator>Fizzgig08</dc:creator>
      <dc:date>2023-01-04T07:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Survey questions - change year on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3001519#M101359</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="493772" data-lia-user-login="Fizzgig08" class="lia-mention lia-mention-user"&gt;Fizzgig08&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes it does! That is what this measure is doing, comparing if 2022's score has increased or improved compared to 2021&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;HasIncreased = 
if(SUM('Table 2'[CurrentTotalScore]) &amp;gt; sum('Table 2'[PreviousTotalScore]), 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you're on track with your report!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jewel&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:39:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3001519#M101359</guid>
      <dc:creator>jewel_at</dc:creator>
      <dc:date>2023-01-04T16:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Survey questions - change year on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3002081#M101398</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="493772" data-lia-user-login="Fizzgig08" class="lia-mention lia-mention-user"&gt;Fizzgig08&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a better way to solve this, instead of having a calculated table where you have to manually enter the year, you can use&amp;nbsp; the following calculated measures. This way, you can use this report in future years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;CurrentScoreSum = 
CALCULATE(SUM('Table'[Score]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;PreviousYearSum = 
var currentSelectedYear = SELECTEDVALUE('Table'[Year])
return 
CALCULATE(
    SUM('Table'[Score]), 'Table'[Year] = CONVERT(currentSelectedYear -1, STRING))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ScoreHasIncreased = 
IF([CurrentScoreSum] &amp;gt; [PreviousYearSum], 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can download the sample .pbix here:&lt;/P&gt;&lt;P&gt;&lt;A title="Compare Scores" href="https://1drv.ms/u/s!AOgdyzw9T9hOjSc" target="_self"&gt;Compare Scores&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jewel&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 14:59:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Survey-questions-change-year-on-year/m-p/3002081#M101398</guid>
      <dc:creator>jewel_at</dc:creator>
      <dc:date>2023-01-05T14:59:31Z</dc:date>
    </item>
  </channel>
</rss>

