<?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: Ratio Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834715#M149935</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219243" data-lia-user-login="quantumudit" class="lia-mention lia-mention-user"&gt;quantumudit&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Bravo!&lt;BR /&gt;That was perfect, it worked.&lt;BR /&gt;Thanks for taking the time to look and provide the solution.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2024 19:36:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-12T19:36:37Z</dc:date>
    <item>
      <title>Ratio Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834490#M149923</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I need to calculate a ratio. I have a table with one column for the amount.&lt;BR /&gt;There is a column that holds the ClientID and another column that holds the Sub Account for those ClientID.&lt;BR /&gt;A ClientID may have more than one SubAccount.&lt;BR /&gt;I need to calculate the ratio held in each Sub Account for ClientIDs.&lt;BR /&gt;I have my dimension table set up with unique Sub Accounts and corresponding ClientIDs.&lt;BR /&gt;How should I arrange my table so I an achieve calculating the ratio? What should my DAX look like?&lt;BR /&gt;This is what I have so far for my DAX...&lt;BR /&gt;TotalAmountPerClient = CALCULATE(SUM('MainTable'[Amount]), ALLEXCEPT(AccoutNumber, AccountNumber[ClientID]))&lt;BR /&gt;TotalAmountPerSubaccount = SUM('MainTable'[Amount])&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Ratio =&lt;/SPAN&gt; &lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[TotalAmountPerClient]&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN&gt;[TotalAmountPerSubaccount]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;Any help appreciated&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Apr 2024 16:52:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834490#M149923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-12T16:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834533#M149925</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great if you could provide more clarity on this problem. What do you mean by "&lt;SPAN&gt;I have a table with one column for the amount"? Does this table have both "ClientID" and "SubAccount" columns as well? The reason behind asking this question is, that we need to the amount is present at the "ClientID" level or, at the "SubAccount" level.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Even better would be, if you provide a sample dataset (anonymized) along with a screenshot/data of the expected answer. That will help us understand the granularity of the data and thereby form the appropriate solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Udit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 17:24:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834533#M149925</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2024-04-12T17:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834587#M149928</link>
      <description>&lt;P&gt;Thanks for taking a look and the question.&lt;BR /&gt;Yes the MainTable does hold all three columns. ClientID, SubAccount and Amount. Here's a sample of the data.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ClientID&lt;/TD&gt;&lt;TD&gt;SubAccount&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;231RQ1&lt;/TD&gt;&lt;TD&gt;231RQ2B1&lt;/TD&gt;&lt;TD&gt;17785&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;231YHP&lt;/TD&gt;&lt;TD&gt;231YHET2&lt;/TD&gt;&lt;TD&gt;185966.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;231YHP&lt;/TD&gt;&lt;TD&gt;231YHET3&lt;/TD&gt;&lt;TD&gt;132062&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 17:54:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834587#M149928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-12T17:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834642#M149931</link>
      <description>&lt;P&gt;You don't need a data model for this but, if you have a model, still this formula will work. Here is the DAX measure that you can use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ratio = 
VAR _clientTotal =
    CALCULATE (
        SUM ( MainTable[Amount] ),
        FILTER (
            ALL ( MainTable ),
            MainTable[ClientID] = SELECTEDVALUE ( MainTable[ClientID] )
        )
    )
VAR _ratio =
    DIVIDE ( SUM ( MainTable[Amount] ), _clientTotal )
RETURN
    _ratio&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well instead of&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt; ( MainTable[Amount] ) you can create a simple measure like this and use it too:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Amount = SUM ( MainTable[Amount] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the screenshot of the solution:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hope this will resolve your issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accepting it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate your Kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 18:41:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834642#M149931</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2024-04-12T18:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834715#M149935</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219243" data-lia-user-login="quantumudit" class="lia-mention lia-mention-user"&gt;quantumudit&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Bravo!&lt;BR /&gt;That was perfect, it worked.&lt;BR /&gt;Thanks for taking the time to look and provide the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 19:36:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834715#M149935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-12T19:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834726#M149936</link>
      <description>&lt;P&gt;Happy to help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt;Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt;Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 19:44:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation/m-p/3834726#M149936</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2024-04-12T19:44:29Z</dc:date>
    </item>
  </channel>
</rss>

