<?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 a value by the value of that product with biggest value on other column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240795#M119235</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;I do apologize as I was answering in a harry without paying much attention. Somehow your question just popped up in my head and I realized I did a stupid&amp;nbsp;mistake in my last code. Please try the following instead:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Result =
DIVIDE (
    [Avg Price],
    MAXX (
        TOPN (
            1,
            ALLSELECTED ( 'All'[PRODUCT DESCRIPTION] ),
            VAR CurrentProduct1 = 'All'[PRODUCT DESCRIPTION]
            RETURN
                CALCULATE ( [MS Butoane SKU], 'All'[PRODUCT DESCRIPTION] = CurrentProduct1 )
        ),
        VAR CurrentProduct2 = 'All'[PRODUCT DESCRIPTION]
        RETURN
            CALCULATE ( [Avg Price], 'All'[PRODUCT DESCRIPTION] = CurrentProduct2 )
    )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 17 May 2023 17:12:40 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-05-17T17:12:40Z</dc:date>
    <item>
      <title>Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3238052#M119071</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following table with some measures in it at Product level:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need a measure that will divide every value from Avg Price by the Avg Price of that Product with the biggest MS CY.&lt;/P&gt;&lt;P&gt;Example: for each product every value from AVG Price will be divided by 166.35.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the following measure to know which Product has the biggest MS CY:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX MS = &lt;/SPAN&gt;&lt;SPAN&gt;FORMAT&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;MAXX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'All'&lt;/SPAN&gt;&lt;SPAN&gt;[PRODUCT DESCRIPTION]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[MS Butoane SKU]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;"General Number"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The result beeing 26%, but I don't know how to substract AVG Price (166.35) of that Product.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 14:08:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3238052#M119071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-16T14:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3238127#M119074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;Result =&lt;BR /&gt;DIVIDE (&lt;BR /&gt;[Avg Price],&lt;BR /&gt;MAXX (&lt;BR /&gt;SELECTCOLUMNS (&lt;BR /&gt;TOPN ( 1, ALL ( 'All'[PRODUCT DESCRIPTION] ), [MS Butoane SKU] ),&lt;BR /&gt;"@Avg", [Avg Price]&lt;BR /&gt;),&lt;BR /&gt;[@Avg]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 14:45:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3238127#M119074</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-16T14:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240006#M119176</link>
      <description>&lt;P&gt;Is not working. It gives me 100% for every product.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 11:01:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240006#M119176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T11:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240118#M119184</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Result =
DIVIDE (
    [Avg Price],
    MAXX (
        SELECTCOLUMNS (
            ALL ( 'All'[PRODUCT DESCRIPTION] ),
            "@Avg", CALCULATE ( [MS Butoane SKU], ALLEXCEPT ( 'All', 'All'[PRODUCT DESCRIPTION] ) )
        ),
        [@Avg]
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 May 2023 12:07:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240118#M119184</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-17T12:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240157#M119190</link>
      <description>&lt;P&gt;This is the result I need:&lt;/P&gt;&lt;P&gt;Avg Price for every product needs to be divided by the Avg Price of that Product with the highest MS.&lt;/P&gt;&lt;P&gt;In this example, the highest MS is 26%, so every row will be divided by 166.346. On row 33 will have 100% because it will divide 166.346 by 166.346.&lt;/P&gt;&lt;P&gt;Depending on the slicer filter with category, the highest MS for that category will change.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 12:26:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240157#M119190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T12:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240318#M119200</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Result =
DIVIDE (
    [Avg Price],
    MAXX (
        TOPN (
            1,
            ALL ( 'All'[PRODUCT DESCRIPTION] ),
            CALCULATE (
                [MS Butoane SKU],
                'All'[PRODUCT DESCRIPTION] = 'All'[PRODUCT DESCRIPTION]
            )
        ),
        CALCULATE (
            [Avg Price],
            'All'[PRODUCT DESCRIPTION] = 'All'[PRODUCT DESCRIPTION]
        )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 May 2023 13:38:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240318#M119200</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-17T13:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240795#M119235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;I do apologize as I was answering in a harry without paying much attention. Somehow your question just popped up in my head and I realized I did a stupid&amp;nbsp;mistake in my last code. Please try the following instead:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Result =
DIVIDE (
    [Avg Price],
    MAXX (
        TOPN (
            1,
            ALLSELECTED ( 'All'[PRODUCT DESCRIPTION] ),
            VAR CurrentProduct1 = 'All'[PRODUCT DESCRIPTION]
            RETURN
                CALCULATE ( [MS Butoane SKU], 'All'[PRODUCT DESCRIPTION] = CurrentProduct1 )
        ),
        VAR CurrentProduct2 = 'All'[PRODUCT DESCRIPTION]
        RETURN
            CALCULATE ( [Avg Price], 'All'[PRODUCT DESCRIPTION] = CurrentProduct2 )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 May 2023 17:12:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3240795#M119235</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-17T17:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a value by the value of that product with biggest value on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3241614#M119284</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp; didn't know you can put variable in the middle of the measure.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 06:14:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-a-value-by-the-value-of-that-product-with-biggest-value/m-p/3241614#M119284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-18T06:14:51Z</dc:date>
    </item>
  </channel>
</rss>

