<?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: Help with dax formula to normalize order values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2634251#M77191</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397538" data-lia-user-login="ase" class="lia-mention lia-mention-user"&gt;ase&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not totally sure what you mean by normalized, but here's some measures to help you out.&amp;nbsp; These give you numbers, so can be used in charts.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Order Count = COUNTROWS('Table')

Substituted Order Count = SUM('Table'[Is substituted])

Substituted Percent = DIVIDE([Substituted Order Count], [Order Count])&lt;/LI-CODE&gt;
&lt;P&gt;if you want the specific text in your example then we can have measures to build that text up.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Text 1 = 
VAR _Product = SELECTEDVALUE('Table'[Ordered product], "Multiple products")
VAR _Result = 
_Product &amp;amp; " " &amp;amp; [Order Count] &amp;amp; " orders total, " &amp;amp; [Substituted Order Count] &amp;amp; " substituted"
RETURN
    _Result&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Text 2 = 
VAR _Product = SELECTEDVALUE('Table'[Ordered product], "Multiple products")
VAR _Result = 
_Product &amp;amp; " " &amp;amp; FORMAT([Substituted Percent] * 100, "#,0") &amp;amp; "% substituted"
RETURN
    _Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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;</description>
    <pubDate>Tue, 12 Jul 2022 16:22:06 GMT</pubDate>
    <dc:creator>PaulOlding</dc:creator>
    <dc:date>2022-07-12T16:22:06Z</dc:date>
    <item>
      <title>Help with dax formula to normalize order values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2634062#M77180</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem to write a DAX formula which normalizes invoice data:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data on the products that were ordered and the products that were received instead ( when the substitute is empty, it means that there was no substitute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me with a Dax formula, which shows the most substituted products in a normalized way. (like under the yellow bar)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 15:04:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2634062#M77180</guid>
      <dc:creator>ase</dc:creator>
      <dc:date>2022-07-12T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dax formula to normalize order values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2634251#M77191</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397538" data-lia-user-login="ase" class="lia-mention lia-mention-user"&gt;ase&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not totally sure what you mean by normalized, but here's some measures to help you out.&amp;nbsp; These give you numbers, so can be used in charts.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Order Count = COUNTROWS('Table')

Substituted Order Count = SUM('Table'[Is substituted])

Substituted Percent = DIVIDE([Substituted Order Count], [Order Count])&lt;/LI-CODE&gt;
&lt;P&gt;if you want the specific text in your example then we can have measures to build that text up.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Text 1 = 
VAR _Product = SELECTEDVALUE('Table'[Ordered product], "Multiple products")
VAR _Result = 
_Product &amp;amp; " " &amp;amp; [Order Count] &amp;amp; " orders total, " &amp;amp; [Substituted Order Count] &amp;amp; " substituted"
RETURN
    _Result&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Text 2 = 
VAR _Product = SELECTEDVALUE('Table'[Ordered product], "Multiple products")
VAR _Result = 
_Product &amp;amp; " " &amp;amp; FORMAT([Substituted Percent] * 100, "#,0") &amp;amp; "% substituted"
RETURN
    _Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Tue, 12 Jul 2022 16:22:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2634251#M77191</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2022-07-12T16:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dax formula to normalize order values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2635761#M77259</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150936" data-lia-user-login="PaulOlding" class="lia-mention lia-mention-user"&gt;PaulOlding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea was to show that in XX% of the cases, apples were substituted with another product.&lt;BR /&gt;The rationale for normalization part comes from the fact that for example we might have ordered 10 apples and 9 of them might have been substituted, and at the same time we might have ordered 1000 oranges, with 350 substituted, so I need to factor for the amount of the products.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately your solution only gives the number of substitutuions, but not the normalized ratio between ordered apples and times they were substituted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;B.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:40:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2635761#M77259</guid>
      <dc:creator>ase</dc:creator>
      <dc:date>2022-07-13T08:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dax formula to normalize order values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2635829#M77266</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397538" data-lia-user-login="ase" class="lia-mention lia-mention-user"&gt;ase&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 'Substituted Percent' measure gives the ratio.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 09:08:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-formula-to-normalize-order-values/m-p/2635829#M77266</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2022-07-13T09:08:15Z</dc:date>
    </item>
  </channel>
</rss>

