<?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 with SUMMARIZE in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3990338#M154754</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="723714" data-lia-user-login="RedaBi" class="lia-mention lia-mention-user"&gt;RedaBi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, try to modify the dax formula to the following formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ratio = 
SUMMARIZE(
    'Prélevement',
    'Prélevement'[Date Opération],
    'Prélevement'[Cd Dist], 
    'Prélevement'[Distrib],
    'Prélevement'[Facial],
    "Total Ventes", SUM('Prélevement'[Facial]),
    "Total Qte", SUM('Prélevement'[Qte Livree]),
    "Ratio Vente", SUMX(
    'Prélevement',
    DIVIDE('Prélevement'[Facial], CALCULATE(SUM('Prélevement'[Facial]), ALL('Prélevement')))
    ) * 100
)
&lt;/LI-CODE&gt;
&lt;P&gt;You can view the following documents to learn more information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/summarize-function-dax" target="_blank"&gt;SUMMARIZE function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/rls-guidance#when-to-avoid-using-rls" target="_blank"&gt;Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2024 06:42:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-13T06:42:55Z</dc:date>
    <item>
      <title>Ratio Calculation with SUMMARIZE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3989598#M154684</link>
      <description>&lt;P&gt;I encountered an issue with calculating the ratio in RLS. When RLS is enabled, the ratio calculation does not work correctly. To work around this problem, I created a separate table to calculate the sales ratio and linked it to a date table. However, the result is not correct. The amount calculation is correct, but the ratio is incorrect. I tried multiplying the result by 100 to obtain the ratio as a percentage, but without success. Here is the measure used,&amp;nbsp;&lt;BR /&gt;Could you help me identify where the problem lies and how to correct the ratio calculation?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ratio = 
SUMMARIZE(
    'Prélevement',
    'Prélevement'[Date Opération],
    'Prélevement'[Cd Dist], 
    'Prélevement'[Distrib],
    'Prélevement'[Facial],
    "Total Ventes", SUM('Prélevement'[Facial]),
    "Total Qte", SUM('Prélevement'[Qte Livree]),
    "Ratio Vente", DIVIDE(SUM('Prélevement'[Facial]), CALCULATE(SUM('Prélevement'[Facial]), ALL('Prélevement')))*100
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:13:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3989598#M154684</guid>
      <dc:creator>RedaBi</dc:creator>
      <dc:date>2024-06-12T21:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation with SUMMARIZE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3989916#M154720</link>
      <description>&lt;P&gt;Most likely you wanted to use ALLSELECTED rather than ALL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;REMOVEFILTERS might be a gentler approach.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 02:01:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3989916#M154720</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-13T02:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation with SUMMARIZE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3990338#M154754</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="723714" data-lia-user-login="RedaBi" class="lia-mention lia-mention-user"&gt;RedaBi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, try to modify the dax formula to the following formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ratio = 
SUMMARIZE(
    'Prélevement',
    'Prélevement'[Date Opération],
    'Prélevement'[Cd Dist], 
    'Prélevement'[Distrib],
    'Prélevement'[Facial],
    "Total Ventes", SUM('Prélevement'[Facial]),
    "Total Qte", SUM('Prélevement'[Qte Livree]),
    "Ratio Vente", SUMX(
    'Prélevement',
    DIVIDE('Prélevement'[Facial], CALCULATE(SUM('Prélevement'[Facial]), ALL('Prélevement')))
    ) * 100
)
&lt;/LI-CODE&gt;
&lt;P&gt;You can view the following documents to learn more information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/summarize-function-dax" target="_blank"&gt;SUMMARIZE function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/rls-guidance#when-to-avoid-using-rls" target="_blank"&gt;Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:42:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3990338#M154754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-13T06:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation with SUMMARIZE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3991634#M154868</link>
      <description>&lt;P&gt;Thank you for your response ,Unfortunately, it doesn't work. When I drag the "Total Ventes" column along with the 'Prélevement'[Distrib] column into a table, the amount is correct, but the ratio is not. I think the issue lies in calculating the total sales of all distributors with the formula CALCULATE(SUM('Prélevement'[Facial]), ALL('Prélevement')).&lt;/P&gt;&lt;P&gt;Please note that the "Prélevement" table is related to a "Calendar" table. Maybe the total needs to be filtered according to the dates specified in the calendar?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 17:18:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3991634#M154868</guid>
      <dc:creator>RedaBi</dc:creator>
      <dc:date>2024-06-13T17:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation with SUMMARIZE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3991635#M154869</link>
      <description>&lt;P&gt;Thank you for your response, Unfortunately, it doesn't work. When I drag the "Total Ventes" column along with the 'Prélevement'[Distrib] column into a table, the amount is correct, but the ratio is not. I think the issue lies in calculating the total sales of all distributors with the formula CALCULATE(SUM('Prélevement'[Facial]), ALL('Prélevement')).&lt;/P&gt;&lt;P&gt;Please note that the "Prélevement" table is related to a "Calendar" table. Maybe the total needs to be filtered according to the dates specified in the calendar?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 17:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3991635#M154869</guid>
      <dc:creator>RedaBi</dc:creator>
      <dc:date>2024-06-13T17:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio Calculation with SUMMARIZE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3993978#M155047</link>
      <description>&lt;P&gt;If it can help, I found a solution to my problem. I used the table only for the sum of sales, linking the table only with the calendar table. Then, I used the sum according to the date filter.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 22:00:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ratio-Calculation-with-SUMMARIZE/m-p/3993978#M155047</guid>
      <dc:creator>RedaBi</dc:creator>
      <dc:date>2024-06-14T22:00:10Z</dc:date>
    </item>
  </channel>
</rss>

