<?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: DAX Calculation (Row by Row Division) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169445#M165639</link>
    <description>&lt;P&gt;Create a &lt;STRONG&gt;DAX measure&lt;/STRONG&gt; to calculate the ratio by dividing the responseCount of headerString A by headerString B for each institution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Institution Ratio =&lt;BR /&gt;VAR responseA =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table'[responseCount]),&lt;BR /&gt;'Table'[headerString] = "A"&lt;BR /&gt;)&lt;BR /&gt;VAR responseB =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table'[responseCount]),&lt;BR /&gt;'Table'[headerString] = "B"&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(responseB = 0, BLANK(), responseA / responseB)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The measure first calculates the sum of responseCount for headerString A and headerString B within the selected filter context (by institution_name).&lt;/LI&gt;&lt;LI&gt;Then it divides the result for headerString A by the result for headerString B.&lt;/LI&gt;&lt;LI&gt;It checks if the denominator (responseB) is zero to avoid division errors, returning BLANK() when there's no valid data.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can place this measure in a table visualization with institution_name to see the ratios for each institution.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2024 06:00:00 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2024-09-24T06:00:00Z</dc:date>
    <item>
      <title>DAX Calculation (Row by Row Division)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169373#M165636</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Power BI and facing issues to create a dax calculation to achieve the following result:&lt;/P&gt;&lt;P&gt;Based on filter selection on ID,&amp;nbsp; headerString we need to compute the ratio. The ratio are to be calculated based on each institution name. (Refer the table below)&lt;/P&gt;&lt;P&gt;e.g For ABC Insitute we need to divide the response count of header string A for id 6 with Response count of header string B for id 6 .i.e 1401233/59 for ABC and similarly 1401000/54 for DEF etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ekam&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;categoryCode&lt;/TD&gt;&lt;TD&gt;optionString&lt;/TD&gt;&lt;TD&gt;headerString&lt;/TD&gt;&lt;TD&gt;responseString&lt;/TD&gt;&lt;TD&gt;responseCount&lt;/TD&gt;&lt;TD&gt;institution_name&lt;/TD&gt;&lt;TD&gt;institution_code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;POST&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1401233&lt;/TD&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;POST&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;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t;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;GHI&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;POST&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;JKL&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;40&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 24 Sep 2024 05:36:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169373#M165636</guid>
      <dc:creator>esingh</dc:creator>
      <dc:date>2024-09-24T05:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Calculation (Row by Row Division)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169445#M165639</link>
      <description>&lt;P&gt;Create a &lt;STRONG&gt;DAX measure&lt;/STRONG&gt; to calculate the ratio by dividing the responseCount of headerString A by headerString B for each institution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Institution Ratio =&lt;BR /&gt;VAR responseA =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table'[responseCount]),&lt;BR /&gt;'Table'[headerString] = "A"&lt;BR /&gt;)&lt;BR /&gt;VAR responseB =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table'[responseCount]),&lt;BR /&gt;'Table'[headerString] = "B"&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(responseB = 0, BLANK(), responseA / responseB)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The measure first calculates the sum of responseCount for headerString A and headerString B within the selected filter context (by institution_name).&lt;/LI&gt;&lt;LI&gt;Then it divides the result for headerString A by the result for headerString B.&lt;/LI&gt;&lt;LI&gt;It checks if the denominator (responseB) is zero to avoid division errors, returning BLANK() when there's no valid data.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can place this measure in a table visualization with institution_name to see the ratios for each institution.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 06:00:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169445#M165639</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-09-24T06:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Calculation (Row by Row Division)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169796#M165641</link>
      <description>&lt;P&gt;Thanks.. Just one more clarification.. we can even add [id] in the filter condition to get the values if ids are different.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 07:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Calculation-Row-by-Row-Division/m-p/4169796#M165641</guid>
      <dc:creator>esingh</dc:creator>
      <dc:date>2024-09-24T07:49:24Z</dc:date>
    </item>
  </channel>
</rss>

