<?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: Calculate Weightfactor based on row count of two tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/4003866#M156231</link>
    <description>&lt;P&gt;I have solved the problem by replacing the measure of &lt;SPAN&gt;wf_som_gebr_jaar_panden by the measure:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;wf_som_gebr_jaar_panden =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_seleted_year&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;EP_online&lt;/SPAN&gt;&lt;SPAN&gt;[ConstructionYear (groepen)]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_selected_application&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;EP_online&lt;/SPAN&gt;&lt;SPAN&gt;[BuildingApplication]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_calculated_total&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNTNOBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BAG_panden&lt;/SPAN&gt;&lt;SPAN&gt;[pandid]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;BAG_panden&lt;/SPAN&gt;&lt;SPAN&gt;[bjr_min (groepen)]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;_seleted_year&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;BAG_panden&lt;/SPAN&gt;&lt;SPAN&gt;[dom_functie]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_selected_application&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;_calculated_total&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;By saving the selected value and filtering the required table based on that value, the correct division is made.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 21 Jun 2024 10:27:04 GMT</pubDate>
    <dc:creator>OffermansWE</dc:creator>
    <dc:date>2024-06-21T10:27:04Z</dc:date>
    <item>
      <title>Calculate Weightfactor based on row count of two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/3999746#M155828</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find the weightfactor by dividing the row count of one table by the row count of another table. For this I have two tables. The first table is called BAG. Within this table I have three columns named pandid, builbjr_min (groepen) and dom_functie. The original table is very large, but I added a measure called wf_som_gebr_jaar to count the amount of rows for the table. See the DAX measure below the table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;wf_som_gebr_jaar_panden = CALCULATE ( &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; DISTINCTCOUNTNOBLANK( BAG_panden[pandid]) , &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; ALLEXCEPT (&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'BAG_panden', &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BAG_panden[bjr_min (groepen)],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BAG_panden[dom_functie]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I also have another table called EP. For this i have done the same, see table below and dax formula:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;wf_som_gebr_jaar_ep_online = calculate(COUNTROWS(EP_online),ALLEXCEPT(EP_online, EP_online[ConstructionYear (groepen)],EP_online[BuildingApplication], EP_online[Code]))&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Now I want to create a new measure in which I divide&amp;nbsp;wf_som_gebr_jaar_panden by&amp;nbsp;wf_som_gebr_jaar_ep_online. However, just dividing the two measures does not seem to work. As a result, I would like a table in the report which looks like this (only with the correct values):&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anything is unclear, please let me know and I will try to elaborate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 08:24:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/3999746#M155828</guid>
      <dc:creator>OffermansWE</dc:creator>
      <dc:date>2024-06-19T08:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Weightfactor based on row count of two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/3999874#M155829</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="700437" data-lia-user-login="OffermansWE" class="lia-mention lia-mention-user"&gt;OffermansWE&lt;/a&gt;&amp;nbsp;-create a measure that calculates the weight factor by dividing the row count of the BAG_panden table by the row count of the EP_online table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wf_som_gebr_jaar_panden =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCTCOUNTNOBLANK(BAG_panden[pandid]),&lt;BR /&gt;ALLEXCEPT(&lt;BR /&gt;BAG_panden,&lt;BR /&gt;BAG_panden[bjr_min (groepen)],&lt;BR /&gt;BAG_panden[dom_functie]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create another measure for EP&lt;/P&gt;&lt;P&gt;wf_som_gebr_jaar_ep_online =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS(EP_online),&lt;BR /&gt;ALLEXCEPT(&lt;BR /&gt;EP_online,&lt;BR /&gt;EP_online[ConstructionYear (groepen)],&lt;BR /&gt;EP_online[BuildingApplication],&lt;BR /&gt;EP_online[Code]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then create measure to calculate percentage from both above measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%weightfactor =&amp;nbsp; [wf_som_gebr_jaar_panden]/[wf_som_gebr_jaar_ep_online]&amp;nbsp;&lt;/P&gt;&lt;P&gt;use divide function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! This will help others on the forum!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 09:30:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/3999874#M155829</guid>
      <dc:creator>rajendraongole1</dc:creator>
      <dc:date>2024-06-19T09:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Weightfactor based on row count of two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/4001215#M155928</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="118660" data-lia-user-login="rajendraongole1" class="lia-mention lia-mention-user"&gt;rajendraongole1&lt;/a&gt;. Unfortunatly this gives the same result as I already had. I have created an example pbix (&lt;A href="https://www.dropbox.com/scl/fi/98zjfbgqmls2cqi7z9rdj/Example_file.pbix?rlkey=83idmeh4l7l4gdwofjbv5ntt5&amp;amp;st=rbnkmaqh&amp;amp;dl=0" target="_blank"&gt;https://www.dropbox.com/scl/fi/98zjfbgqmls2cqi7z9rdj/Example_file.pbix?rlkey=83idmeh4l7l4gdwofjbv5ntt5&amp;amp;st=rbnkmaqh&amp;amp;dl=0&lt;/A&gt;) of the results and I have added the expected results. Also you can see how the tables are related within this pbix. I actually want to divide the first table by the second table to get the right results in the third table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 06:09:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/4001215#M155928</guid>
      <dc:creator>OffermansWE</dc:creator>
      <dc:date>2024-06-20T06:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Weightfactor based on row count of two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/4003866#M156231</link>
      <description>&lt;P&gt;I have solved the problem by replacing the measure of &lt;SPAN&gt;wf_som_gebr_jaar_panden by the measure:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;wf_som_gebr_jaar_panden =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_seleted_year&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;EP_online&lt;/SPAN&gt;&lt;SPAN&gt;[ConstructionYear (groepen)]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_selected_application&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;EP_online&lt;/SPAN&gt;&lt;SPAN&gt;[BuildingApplication]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_calculated_total&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNTNOBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;BAG_panden&lt;/SPAN&gt;&lt;SPAN&gt;[pandid]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;BAG_panden&lt;/SPAN&gt;&lt;SPAN&gt;[bjr_min (groepen)]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;_seleted_year&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;BAG_panden&lt;/SPAN&gt;&lt;SPAN&gt;[dom_functie]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_selected_application&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;_calculated_total&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;By saving the selected value and filtering the required table based on that value, the correct division is made.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Jun 2024 10:27:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Weightfactor-based-on-row-count-of-two-tables/m-p/4003866#M156231</guid>
      <dc:creator>OffermansWE</dc:creator>
      <dc:date>2024-06-21T10:27:04Z</dc:date>
    </item>
  </channel>
</rss>

