<?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 Divide function isnt working correctly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-function-isnt-working-correctly/m-p/3239604#M119151</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a very simple issue but seems to be causing me issues than it should but I am doing a simple divide dax function however the numbers being returned are not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried opening a completely new document and trying the divide function there, thinking it might be a filter, but still getting all the wrong numbers in the column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula is&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;HitRate = &lt;/SPAN&gt;&lt;SPAN&gt;Divide&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CRM_DBMarketingRolling12mthsBaseStatsDetailed&lt;/SPAN&gt;&lt;SPAN&gt;[Won]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CRM_DBMarketingRolling12mthsBaseStatsDetailed&lt;/SPAN&gt;&lt;SPAN&gt;[Won]&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;CRM_DBMarketingRolling12mthsBaseStatsDetailed&lt;/SPAN&gt;&lt;SPAN&gt;[Lost]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It is a calculated column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 07:19:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-05-17T07:19:19Z</dc:date>
    <item>
      <title>Divide function isnt working correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-function-isnt-working-correctly/m-p/3239604#M119151</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a very simple issue but seems to be causing me issues than it should but I am doing a simple divide dax function however the numbers being returned are not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried opening a completely new document and trying the divide function there, thinking it might be a filter, but still getting all the wrong numbers in the column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula is&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;HitRate = &lt;/SPAN&gt;&lt;SPAN&gt;Divide&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CRM_DBMarketingRolling12mthsBaseStatsDetailed&lt;/SPAN&gt;&lt;SPAN&gt;[Won]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CRM_DBMarketingRolling12mthsBaseStatsDetailed&lt;/SPAN&gt;&lt;SPAN&gt;[Won]&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;CRM_DBMarketingRolling12mthsBaseStatsDetailed&lt;/SPAN&gt;&lt;SPAN&gt;[Lost]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It is a calculated column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 07:19:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-function-isnt-working-correctly/m-p/3239604#M119151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T07:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Divide function isnt working correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-function-isnt-working-correctly/m-p/3243776#M119423</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) We can create a&amp;nbsp; calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;HitRate = DIVIDE('Table'[Won],'Table'[Won]+'Table'[Lost],0)&lt;/LI-CODE&gt;
&lt;P&gt;Or we can create two calculated columns.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;L+W = 'Table'[Lost]+'Table'[Won]&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Rate2 = DIVIDE('Table'[Won],'Table'[L+W],0) &lt;/LI-CODE&gt;
&lt;P&gt;Or we can create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _a=MAX('Table'[Won])
var _b=MAX('Table'[Lost])+MAX('Table'[Won])
return DIVIDE(_a,_b,0)&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 07:05:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-function-isnt-working-correctly/m-p/3243776#M119423</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-19T07:05:29Z</dc:date>
    </item>
  </channel>
</rss>

