<?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 Calculating the sales lift based on temperature using DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3199989#M116294</link>
    <description>&lt;P&gt;I want to calculate the lift in the sales numbers if the outside temperature increases. For example if it is 30°C outside you would sell more icecream than when it is 10°C outside. I want to do this by first creating the average of base sales under 20°C and then divide the average sales that occure on days above 20°C&amp;nbsp; with this base. This gives me a lift factor (ex. 1.3 when it is 25°C meaning i would sell 30% more than compared with my base).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have my sales and temperature data in 1 table (see pbi file below). I now have created 2 extra tables in Power Query, one containing sales data on days below 20°C&amp;nbsp; and one containing sales data on days equal and above 20°C. In DAX in calculate the sales average of both tables and divide them by eachother. I put the data in a matrix and add the temperature (bins) to the columns. I want to see the uplift per weekday so i also added the weekdays in the rows. This gives me the matrix below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But when adding more and more data my Power BI file gets bigger and slower and the two extra tables i created are not helping. I want to calculate the matrix shown above with only using 1 total sales table and DAX measures. But when i try this and add the data to a matrix i only get the total uplift, not per&amp;nbsp;°C bin because it's shows 'infinity'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you please help me to created the above matrix by only using DAX and the 'Sales_Total' table (and not the two extra tables i created) in the attached PBI file below?&lt;BR /&gt;&lt;BR /&gt;Power BI file (onedrive link):&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AotJBlCCCXxigpInncpDI7AkLwXF2w?e=dvdp0o" target="_blank"&gt;Power BI Example.pbix&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Apr 2023 12:17:06 GMT</pubDate>
    <dc:creator>carlosxxss</dc:creator>
    <dc:date>2023-04-21T12:17:06Z</dc:date>
    <item>
      <title>Calculating the sales lift based on temperature using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3199989#M116294</link>
      <description>&lt;P&gt;I want to calculate the lift in the sales numbers if the outside temperature increases. For example if it is 30°C outside you would sell more icecream than when it is 10°C outside. I want to do this by first creating the average of base sales under 20°C and then divide the average sales that occure on days above 20°C&amp;nbsp; with this base. This gives me a lift factor (ex. 1.3 when it is 25°C meaning i would sell 30% more than compared with my base).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have my sales and temperature data in 1 table (see pbi file below). I now have created 2 extra tables in Power Query, one containing sales data on days below 20°C&amp;nbsp; and one containing sales data on days equal and above 20°C. In DAX in calculate the sales average of both tables and divide them by eachother. I put the data in a matrix and add the temperature (bins) to the columns. I want to see the uplift per weekday so i also added the weekdays in the rows. This gives me the matrix below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But when adding more and more data my Power BI file gets bigger and slower and the two extra tables i created are not helping. I want to calculate the matrix shown above with only using 1 total sales table and DAX measures. But when i try this and add the data to a matrix i only get the total uplift, not per&amp;nbsp;°C bin because it's shows 'infinity'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you please help me to created the above matrix by only using DAX and the 'Sales_Total' table (and not the two extra tables i created) in the attached PBI file below?&lt;BR /&gt;&lt;BR /&gt;Power BI file (onedrive link):&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AotJBlCCCXxigpInncpDI7AkLwXF2w?e=dvdp0o" target="_blank"&gt;Power BI Example.pbix&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 12:17:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3199989#M116294</guid>
      <dc:creator>carlosxxss</dc:creator>
      <dc:date>2023-04-21T12:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the sales lift based on temperature using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3205969#M116760</link>
      <description>&lt;P&gt;See attached&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 01:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3205969#M116760</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-04-26T01:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the sales lift based on temperature using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3210667#M117081</link>
      <description>&lt;P&gt;Thank you that worked! For those wondering what is was without opening the attachment:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I divided both averages with the '/' operator, which created the 'infinity' value. What&amp;nbsp;@Ibendlin did was creating 2 measures:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average below 20 = CALCULATE(AVERAGE(Sales_Total[Sales]),REMOVEFILTERS(Sales_Total[temperature_2m_max °C (bins)]),Sales_Total[temperature_2m_max °C]&amp;lt;20)

Lift = DIVIDE(AVERAGE(Sales_Total[Sales),[Average below 20])&lt;/LI-CODE&gt;&lt;P&gt;And then put the output of the Lift measure in the matrix&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 06:55:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-sales-lift-based-on-temperature-using-DAX/m-p/3210667#M117081</guid>
      <dc:creator>carlosxxss</dc:creator>
      <dc:date>2023-04-28T06:55:32Z</dc:date>
    </item>
  </channel>
</rss>

