<?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: [DAX] How to apply a multiplier on a Parameter based on a Date and another parameter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178688#M50684</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337488" data-lia-user-login="BunzietheBoo" class="lia-mention lia-mention-user"&gt;BunzietheBoo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you thought about adding the Multiplier to the Sales table, either in Power Query or the source?&lt;/P&gt;
&lt;P&gt;From a modelling perspective that's where it should go if you're going to use it in a measure.&lt;/P&gt;
&lt;P&gt;The resulting measure will also perform better - something to consider if you have a large amount of data.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 17:36:09 GMT</pubDate>
    <dc:creator>PaulOlding</dc:creator>
    <dc:date>2021-11-08T17:36:09Z</dc:date>
    <item>
      <title>[DAX] How to apply a multiplier on a Parameter based on a Date and another parameter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178387#M50677</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;First post for me here on a problem I have for a few days.&lt;BR /&gt;I am working on a dashboard displaying sales data for a bunch of shops.&lt;BR /&gt;To be properly interpreted, the sales numbers has to be adjusted by a multiplier.&lt;BR /&gt;This multiplier is different for every shop and is changing through time.&lt;BR /&gt;&lt;BR /&gt;The multiplier values are stored in a "Multiplier" table &amp;nbsp;:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ShopID&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Multiplier&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01.01.2018&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01.01.2020&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01.01.2018&lt;/TD&gt;&lt;TD&gt;1.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;02.03.2019&lt;/TD&gt;&lt;TD&gt;1.05&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;On the other end, the sales values are stored in another "Sales"table :&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ShopID&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;SalesNb&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01.01.2018&lt;/TD&gt;&lt;TD&gt;545&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01.01.2018&lt;/TD&gt;&lt;TD&gt;362&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;01.01.2018&lt;/TD&gt;&lt;TD&gt;421&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;02.01.2018&lt;/TD&gt;&lt;TD&gt;532&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;02.01.2018&lt;/TD&gt;&lt;TD&gt;350&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(...)&lt;/TD&gt;&lt;TD&gt;(...)&lt;/TD&gt;&lt;TD&gt;(...)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I also have a "DateTable" where I store all the date input of my data model and a "Shop" Table.&lt;BR /&gt;Regarding the relationships :&amp;nbsp;&lt;BR /&gt;"DateTable"&amp;nbsp; &amp;nbsp; 1 ----&amp;gt;-----*&amp;nbsp; &amp;nbsp; "Sales"&lt;BR /&gt;"Shop"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 ----&amp;gt;---- *&amp;nbsp; &amp;nbsp; "Sales"&lt;BR /&gt;"Shop"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 ----&amp;gt;-----*&amp;nbsp; &amp;nbsp; "Multiplier"&lt;BR /&gt;"DateTable"&amp;nbsp; &amp;nbsp; 1 ----&amp;gt;---- *&amp;nbsp; &amp;nbsp; "Multiplier"&lt;BR /&gt;&lt;BR /&gt;My goal is to have a measure that return for a &lt;STRONG&gt;given asset&lt;/STRONG&gt; and for a &lt;STRONG&gt;given date&lt;/STRONG&gt;, the multiplier that should be apply to the Sales number.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This measure will then be used in a SWITCH measure to allow the user to pick if they want the adjusted number or not.&lt;BR /&gt;Good luck and tell me if you want more information !&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 15:11:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178387#M50677</guid>
      <dc:creator>BunzietheBoo</dc:creator>
      <dc:date>2021-11-08T15:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: [DAX] How to apply a multiplier on a Parameter based on a Date and another parameter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178688#M50684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="337488" data-lia-user-login="BunzietheBoo" class="lia-mention lia-mention-user"&gt;BunzietheBoo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you thought about adding the Multiplier to the Sales table, either in Power Query or the source?&lt;/P&gt;
&lt;P&gt;From a modelling perspective that's where it should go if you're going to use it in a measure.&lt;/P&gt;
&lt;P&gt;The resulting measure will also perform better - something to consider if you have a large amount of data.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 17:36:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178688#M50684</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-11-08T17:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: [DAX] How to apply a multiplier on a Parameter based on a Date and another parameter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178723#M50686</link>
      <description>&lt;P&gt;Some DAX to add it as a calculated column to Sales would be&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Multiplier = 
VAR _Shop = Sales[ShopID]
VAR _Date = Sales[Date]
VAR _Latest = 
TOPN(
    1,
    FILTER(Multiplier, Multiplier[Date] &amp;lt;= _Date &amp;amp;&amp;amp; Multiplier[ShopID] = _Shop),
    Multiplier[Date], DESC
)
RETURN
MAXX(_Latest, Multiplier[Multiplier])&lt;/LI-CODE&gt;
&lt;P&gt;The measure is then relatively simple&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales with Multiplier = 
SUMX(
    Sales,
    Sales[SalesNb] * Sales[Multiplier]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Nov 2021 17:52:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-apply-a-multiplier-on-a-Parameter-based-on-a-Date-and/m-p/2178723#M50686</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-11-08T17:52:58Z</dc:date>
    </item>
  </channel>
</rss>

