<?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 Store measure output in a table for year over year analysis in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/970318#M11579</link>
    <description>&lt;P&gt;&amp;nbsp;I have a sales table with revenue, qty by product and time.&amp;nbsp; I want to do an price-volume analysis by performing for each material the formula below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Year ASP = sum(Current Year Revenue)/ sum(Current Year quantity)&lt;/P&gt;&lt;P&gt;Prior Year ASP = sum(Prior Year Revenue)/ sum(Prior Year quantity)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Price Impact = (Current Year ASP - Prior Year ASP ) * Prior Year Quantity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As of now, the Current/Prior Year Revenue and Quantity are defined as Measures and they work fine.&lt;/P&gt;&lt;P&gt;ASP cannot be calculated as a measure as it will divide the sum of revenue of different type of products by sum of their quantity. This will be incorrect. So I need to calculate ASP at each row level and then based on that ASP calculate the ASP change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using summarize columns to convert the cy, py number matrix in a table so that i can then do row by row calculation. But all combinations of summarize, summarize,sumx columns are failing either not giving right results or giving error Memory allocation failure.&lt;/P&gt;&lt;P&gt;How can I solve this problem ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anup&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2020 07:17:32 GMT</pubDate>
    <dc:creator>anup_kumar</dc:creator>
    <dc:date>2020-03-12T07:17:32Z</dc:date>
    <item>
      <title>Store measure output in a table for year over year analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/970318#M11579</link>
      <description>&lt;P&gt;&amp;nbsp;I have a sales table with revenue, qty by product and time.&amp;nbsp; I want to do an price-volume analysis by performing for each material the formula below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Year ASP = sum(Current Year Revenue)/ sum(Current Year quantity)&lt;/P&gt;&lt;P&gt;Prior Year ASP = sum(Prior Year Revenue)/ sum(Prior Year quantity)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Price Impact = (Current Year ASP - Prior Year ASP ) * Prior Year Quantity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As of now, the Current/Prior Year Revenue and Quantity are defined as Measures and they work fine.&lt;/P&gt;&lt;P&gt;ASP cannot be calculated as a measure as it will divide the sum of revenue of different type of products by sum of their quantity. This will be incorrect. So I need to calculate ASP at each row level and then based on that ASP calculate the ASP change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using summarize columns to convert the cy, py number matrix in a table so that i can then do row by row calculation. But all combinations of summarize, summarize,sumx columns are failing either not giving right results or giving error Memory allocation failure.&lt;/P&gt;&lt;P&gt;How can I solve this problem ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anup&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 07:17:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/970318#M11579</guid>
      <dc:creator>anup_kumar</dc:creator>
      <dc:date>2020-03-12T07:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Store measure output in a table for year over year analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/970467#M11585</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="214751" data-lia-user-login="anup_kumar" class="lia-mention lia-mention-user"&gt;anup_kumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;without detailed knowledge about your data model, it's difficult to provide profound advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, I assume you can utilize the table iterator function SUMX (&lt;A href="https://dax.guide/sumx/" target="_blank"&gt;https://dax.guide/sumx/&lt;/A&gt;) that allows iterating across a table, maybe the fact table that contains the quantity and revenue columns to perform your calculations on a row level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 08:43:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/970467#M11585</guid>
      <dc:creator>TomMartens</dc:creator>
      <dc:date>2020-03-12T08:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Store measure output in a table for year over year analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/971414#M11627</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="31" data-lia-user-login="TomMartens" class="lia-mention lia-mention-user"&gt;TomMartens&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Data model looks something like below&lt;BR /&gt;Sales table - Material, InvoiceDate, Country, Entity, Qty, Net Revenue&lt;BR /&gt;Date Table - standard date table with key as date&lt;BR /&gt;Entity Master - Entity, Entity Name&lt;BR /&gt;Material Master - Material, Material Name, Other Attributes&lt;BR /&gt;Geography Master - Country, Country name.&lt;/P&gt;&lt;P&gt;Measures defined as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CY_Start_Date = if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=0,&lt;BR /&gt;FIRSTDATE(Date_Table[Report_Date]),&lt;BR /&gt;if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=1,&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),1,year),&lt;BR /&gt;if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=2,&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),2,year),&lt;BR /&gt;if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=3,&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),3,year),&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),4,year)))))&lt;/P&gt;&lt;P&gt;CY_End_Date = EDATE(MAX(Date_Table[Report_Date]),0)&lt;/P&gt;&lt;P&gt;PY_Start_Date = if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=0,&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),-1,year),&lt;BR /&gt;if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=1,&lt;BR /&gt;FIRSTDATE(Date_Table[Report_Date]),&lt;BR /&gt;if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=2,&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),1,year),&lt;BR /&gt;if(datediff(min(Date_Table[Report_Date]),max(Date_Table[Report_Date]),year)=3,&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),2,year),&lt;BR /&gt;dateadd(FIRSTDATE(Date_Table[Report_Date]),3,year)))))&lt;/P&gt;&lt;P&gt;PY_End_Date = EDATE(MAX(Date_Table[Date]),-12)&lt;/P&gt;&lt;P&gt;CY_Revenue = CALCULATE(SUM(Sales[NET_SALES]),DATESBETWEEN(Date_Table[Date],Measures_AGGR[CY_Start_Date],Measures_AGGR[CY_End_Date]))&lt;BR /&gt;PY_Revenue = CALCULATE(Round( SUM(Sales[NET_SALES]) ,0),DATESBETWEEN(Date_Table[Date], Measures_AGGR[PY_Start_Date], Measures_AGGR[PY_End_Date]))&lt;/P&gt;&lt;P&gt;CY_Revenue_CL = CALCULATE(&lt;BR /&gt;SUMX(Sales, [CY_Revenue])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SUMX measure does not work and gives a out of memory error .&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Anup&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 21:42:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Store-measure-output-in-a-table-for-year-over-year-analysis/m-p/971414#M11627</guid>
      <dc:creator>anup_kumar</dc:creator>
      <dc:date>2020-03-12T21:42:10Z</dc:date>
    </item>
  </channel>
</rss>

