<?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: Divide two identical Measures which refer to filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2767099#M85983</link>
    <description>&lt;P&gt;Some time was, but I have to answer you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;: Thank you very very much!&lt;BR /&gt;That was what I was looking for. And your explanation helped me a lot &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 11:35:24 GMT</pubDate>
    <dc:creator>Do5779</dc:creator>
    <dc:date>2022-09-14T11:35:24Z</dc:date>
    <item>
      <title>Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2672746#M79765</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope my question is at the right place of the forum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I havn't found the right answer yet so I hope you can help me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main aim is to divide two measures.&amp;nbsp; Thats clear, but it is a bit more complex.&lt;/P&gt;&lt;P&gt;I have two filters (date and a number) which filters each measure by the report user. The "number" is needed for the calculation.&amp;nbsp; So for example Measure 1 (M1) is calculated at 01.01.2000 and the user choose the Number one, M2 for 03.02.2001 and Number 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date-table for the example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2000&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03.02.2001&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation of each measure is absolutly identical to the other one. (For the example M1=Price * Number --&amp;gt; 2*1=2 / M2=3*3 =9)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to divide the result of M1 to M2 (M1/M2=&amp;gt;2/9=0,22). The calcualtion of M1 and M2 works (I displayed it at the board) but if I create a new measure called M3= M1/M2 it wont work.&amp;nbsp;I have also no idea, how I can storage the subresult or write it with the dax formular calculate, because the filter are identical. Is there a possibility to&amp;nbsp;refer direct to the filter? (In some other programming languages you can adress like Filter1.Date orr something like that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 11:21:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2672746#M79765</guid>
      <dc:creator>Do5779</dc:creator>
      <dc:date>2022-08-01T11:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2673371#M79797</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the measure is based on the same table, only based on different parameters (date and number)? If you want to show the difference between the two, the parameters must come from separate tables, because one table cannot show two parameters at the same time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you have a total of four tables for your parameters:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Date parameter for M1 (Table: DateM1);&lt;/LI&gt;&lt;LI&gt;Date parameter for M2 (Table: DateM2);&lt;/LI&gt;&lt;LI&gt;Number parameter for M1&amp;nbsp;(Table: NumberM1);&lt;/LI&gt;&lt;LI&gt;Number parameter for M2 (Table: NumberM2).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Make sure the four tables are not connected through relationships in your model.&amp;nbsp;These are the tables that your report users use as slicers. You can transfer the selected parameters as filter context using the CALCULATE function.&amp;nbsp;This is what your code would look like for M1:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;M1 =
CALCULATE (
    [Price] * [Number],
    TREATAS ( VALUES ( DateM1[Date] ), Table[Date] ),
    TREATAS ( VALUES ( NumberM1[Number] ), Table[Number] )
)&lt;/LI-CODE&gt;&lt;P&gt;And so for M2:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;M2 =
CALCULATE (
    [Price] * [Number],
    TREATAS ( VALUES ( DateM2[Date] ), Table[Date] ),
    TREATAS ( VALUES ( NumberM2[Number] ), Table[Number] )
)
​&lt;/LI-CODE&gt;&lt;P&gt;And M3 is then the division:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;M3 =
DIVIDE ( [M1], [M2] )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Aug 2022 15:23:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2673371#M79797</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-08-01T15:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2675428#M79907</link>
      <description>&lt;P&gt;Tamks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;&amp;nbsp;this solution works for now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&amp;nbsp;but is there a a way to pass a value from a slicer to my&amp;nbsp;filter in only one direction so that there is no connecteion which kills my calculation? I want to set my slicer and the one filter is the start and the second the end of the period?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Slicer:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;End of Period:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Beginn for the calculation:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 11:43:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2675428#M79907</guid>
      <dc:creator>Do5779</dc:creator>
      <dc:date>2022-08-02T11:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2675811#M79951</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="416741" data-lia-user-login="Do5779" class="lia-mention lia-mention-user"&gt;Do5779&lt;/a&gt;&amp;nbsp; Sorry, but I don't quite understand what you mean. What is the differnce between your slicer and date texts? What tables are they based on and how are they related to each other?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 14:07:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2675811#M79951</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-08-02T14:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2677232#M80044</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;&amp;nbsp;no problem, let me explain it a bit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The slicer is for a duration and price diagram. At the beginning I calculate M1, which I have described at the beginning of my post. At the end date there is M2. Now the relative difference is calculated between the two dates, which is already working.&lt;/P&gt;&lt;P&gt;But the user have to set the filters for the calculation and then set the slicer to see the chart for the same duration (the start date of chart = M1 / End date of chart = M2).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I originally wanted to do is that the user set the slicer of the bar chart and then there is the calculation of the measures, but how you explained there is no possibility because of the present connection.&lt;BR /&gt;Now the question is if&amp;nbsp; "I can tell the filter for calculation M1" : If slicer date is 01.01.2000 then you have to be the 01.01.2000, without physically connection of the tables.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 05:30:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2677232#M80044</guid>
      <dc:creator>Do5779</dc:creator>
      <dc:date>2022-08-03T05:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2682509#M80389</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="416741" data-lia-user-login="Do5779" class="lia-mention lia-mention-user"&gt;Do5779&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand you correctly, you want to base both M1 and M2 on the slicer: M1 on the start date of the slicer and M2 on the end date.&amp;nbsp;In this case you only need one date table. So you just need to use the 'DateM1' table from before and you could just call the table 'Date'.&amp;nbsp;We can determine both the minimum and maximum of this table&amp;nbsp;and apply this as filter context.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code for M1:&lt;/P&gt;&lt;PRE&gt;M1 =
VAR MinDate =
    MIN ( Date[Date] )
RETURN
    CALCULATE (
        [Price] * [Number],
        Table[Date] = MinDate,
        TREATAS ( VALUES ( NumberM1[Number] ), Table[Number] )
    )&lt;/PRE&gt;&lt;P&gt;And this is the code for M2:&lt;/P&gt;&lt;PRE&gt;M2 =
VAR MaxDate =
    MAX ( Date[Date] )
RETURN
    CALCULATE (
        [Price] * [Number],
        Table[Date] = MaxDate,
        TREATAS ( VALUES ( NumberM1[Number] ), Table[Number] )
    )&lt;/PRE&gt;&lt;P&gt;Is this what you're looking for?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 18:11:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2682509#M80389</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-08-04T18:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two identical Measures which refer to filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2767099#M85983</link>
      <description>&lt;P&gt;Some time was, but I have to answer you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417546" data-lia-user-login="Barthel" class="lia-mention lia-mention-user"&gt;Barthel&lt;/a&gt;: Thank you very very much!&lt;BR /&gt;That was what I was looking for. And your explanation helped me a lot &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 11:35:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-identical-Measures-which-refer-to-filter/m-p/2767099#M85983</guid>
      <dc:creator>Do5779</dc:creator>
      <dc:date>2022-09-14T11:35:24Z</dc:date>
    </item>
  </channel>
</rss>

