<?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: Same measure shows different results in different visuals. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2992054#M100697</link>
    <description>&lt;P&gt;I found a solution. I used ChatGPT (OpenAI) and asked it the question, and it actually solved it. The error was that I was using the sum of the value and not the sum of the max value. Here is the correct code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Opp YoY $ Measure = 
VAR _PriorYR = 
CALCULATE(
    SUM('Opportunity Product'[extendedamount]
    ),
    Opportunity[createdon].[Year] = MAX (Opportunity[createdon].[Year]) -1
)
VAR _CurrentYR = 
CALCULATE(
    SUM('Opportunity Product'[extendedamount]
    ),
    Opportunity[createdon].[Year] = MAX (Opportunity[createdon].[Year])
)

RETURN
DIVIDE(_CurrentYR-_PriorYR,_PriorYR)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 28 Dec 2022 17:10:29 GMT</pubDate>
    <dc:creator>jwin2424</dc:creator>
    <dc:date>2022-12-28T17:10:29Z</dc:date>
    <item>
      <title>Same measure shows different results in different visuals.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2977477#M99722</link>
      <description>&lt;P&gt;Hello community! This is driving me crazy. Here is my measure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Opp YoY = 
VAR _PriorYR = 
CALCULATE(
    SUM('Opportunity Product'[extendedamount]
    ),
    Opportunity[createdon].[Year] = MAX (Opportunity[createdon].[Year]) -1
)
VAR _CurrentYR = sum('Opportunity Product'[extendedamount])
RETURN
DIVIDE(_CurrentYR-_PriorYR,_PriorYR)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When I put this measure into a table, it yields the correct rate of change. When I put this SAME measure into a bar chart for the line, the results ADD 1. It should say 17%, but it says 117%. If I add -1 to the formula, then the table also minuses 1, and I don't want that. I want BOTH to say 17%. What am I missing?&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;EDIT: I figured I should also note that if I remove a 2021 from the bar chart, then the % is correct. It is only when I add another year to the bar chart that it becomes 117% instead of 17%.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 20:54:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2977477#M99722</guid>
      <dc:creator>jwin2424</dc:creator>
      <dc:date>2022-12-19T20:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Same measure shows different results in different visuals.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2977661#M99734</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343802" data-lia-user-login="jwin2424" class="lia-mention lia-mention-user"&gt;jwin2424&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems you have month on the x axis, but it cant differentiate it is month of 2021 or 2022, so it sums.&lt;/P&gt;&lt;P&gt;To make YoY comparison, try to use DAX code to make the time/year shift, like DATEADD function.&lt;/P&gt;&lt;P&gt;check this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/DATEADD-function/td-p/2113441" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/DATEADD-function/td-p/2113441&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 00:29:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2977661#M99734</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-12-20T00:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Same measure shows different results in different visuals.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2979751#M99870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;* Data updated, so percentages dont match the first post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took the measure and moved it from X to Y on the table, and the % is still correct for each month except for the grand total. The total is essentially taking 2022 and 2021 sum and dividing it by 2021. So you are correct that putting it on the X axis is causing this. The bar chart is giving me the Grand Total of the two years and not the total of the month.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I can't use DATEADD because I am on a fiscal calendar, and the YoY by month won't be accurate. I have already tried this, and the numbers aren't correct.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any other suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 17:51:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2979751#M99870</guid>
      <dc:creator>jwin2424</dc:creator>
      <dc:date>2022-12-20T17:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Same measure shows different results in different visuals.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2992054#M100697</link>
      <description>&lt;P&gt;I found a solution. I used ChatGPT (OpenAI) and asked it the question, and it actually solved it. The error was that I was using the sum of the value and not the sum of the max value. Here is the correct code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Opp YoY $ Measure = 
VAR _PriorYR = 
CALCULATE(
    SUM('Opportunity Product'[extendedamount]
    ),
    Opportunity[createdon].[Year] = MAX (Opportunity[createdon].[Year]) -1
)
VAR _CurrentYR = 
CALCULATE(
    SUM('Opportunity Product'[extendedamount]
    ),
    Opportunity[createdon].[Year] = MAX (Opportunity[createdon].[Year])
)

RETURN
DIVIDE(_CurrentYR-_PriorYR,_PriorYR)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 Dec 2022 17:10:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-measure-shows-different-results-in-different-visuals/m-p/2992054#M100697</guid>
      <dc:creator>jwin2424</dc:creator>
      <dc:date>2022-12-28T17:10:29Z</dc:date>
    </item>
  </channel>
</rss>

