<?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 How to do Vertical and Horizontal Analysis in percentages with 3 levels in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287362#M170162</link>
    <description>&lt;P&gt;Hello friends!&lt;/P&gt;&lt;P&gt;I have a pbix file with an example of a database. In it I have the categories in rows (3 levels) and the years and months in columns. As if it were an income statement.&lt;/P&gt;&lt;P&gt;Please help me with a vertical and horizontal analysis of the data in percentages.&lt;/P&gt;&lt;P&gt;I'm attaching the files and an image.&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file.rar (.pbix and .xlsx)&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1C7wTH7rzKXbOg5BrsGdd0J6kxyXuZwr-/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1C7wTH7rzKXbOg5BrsGdd0J6kxyXuZwr-/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file .pbix&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1YNwDlwJtpuk3WRuFoQd4G2l_fIvEs2Ov/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1YNwDlwJtpuk3WRuFoQd4G2l_fIvEs2Ov/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file .xlsx&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/spreadsheets/d/1gZbGvlFG06FR-frxDOkqdHefDlWnMKgb/edit?usp=drive_link&amp;amp;ouid=102705455705218557937&amp;amp;rtpof=true&amp;amp;sd=true" target="_blank"&gt;https://docs.google.com/spreadsheets/d/1gZbGvlFG06FR-frxDOkqdHefDlWnMKgb/edit?usp=drive_link&amp;amp;ouid=102705455705218557937&amp;amp;rtpof=true&amp;amp;sd=true&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Sun, 17 Nov 2024 01:04:46 GMT</pubDate>
    <dc:creator>carlosroston</dc:creator>
    <dc:date>2024-11-17T01:04:46Z</dc:date>
    <item>
      <title>How to do Vertical and Horizontal Analysis in percentages with 3 levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287362#M170162</link>
      <description>&lt;P&gt;Hello friends!&lt;/P&gt;&lt;P&gt;I have a pbix file with an example of a database. In it I have the categories in rows (3 levels) and the years and months in columns. As if it were an income statement.&lt;/P&gt;&lt;P&gt;Please help me with a vertical and horizontal analysis of the data in percentages.&lt;/P&gt;&lt;P&gt;I'm attaching the files and an image.&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file.rar (.pbix and .xlsx)&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1C7wTH7rzKXbOg5BrsGdd0J6kxyXuZwr-/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1C7wTH7rzKXbOg5BrsGdd0J6kxyXuZwr-/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file .pbix&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1YNwDlwJtpuk3WRuFoQd4G2l_fIvEs2Ov/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1YNwDlwJtpuk3WRuFoQd4G2l_fIvEs2Ov/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file .xlsx&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/spreadsheets/d/1gZbGvlFG06FR-frxDOkqdHefDlWnMKgb/edit?usp=drive_link&amp;amp;ouid=102705455705218557937&amp;amp;rtpof=true&amp;amp;sd=true" target="_blank"&gt;https://docs.google.com/spreadsheets/d/1gZbGvlFG06FR-frxDOkqdHefDlWnMKgb/edit?usp=drive_link&amp;amp;ouid=102705455705218557937&amp;amp;rtpof=true&amp;amp;sd=true&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2024 01:04:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287362#M170162</guid>
      <dc:creator>carlosroston</dc:creator>
      <dc:date>2024-11-17T01:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Vertical and Horizontal Analysis in percentages with 3 levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287429#M170167</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="771529" data-lia-user-login="carlosroston" class="lia-mention lia-mention-user"&gt;carlosroston&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You sorted dDRE[Nivel 1] column with&amp;nbsp;&lt;SPAN&gt;dDRE[Ordem], so if you want to remove filters on [Nivel 1] you need to remove filters on both [Nivel 1] and [Ordem] column.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I understand your &amp;nbsp;expected results correctly then this is how you need to modify your measure&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% Valor Orig Parc (n1n2c) V2 (PBI Community) = 
Var __Numerator = [Valor Orig Parc]
Var __Denominator = 
                    SWITCH(
                        TRUE(),
                          ISINSCOPE(dDRE[Categoria 1]),   CALCULATE([Valor Orig Parc],ALLSELECTED(dDRE[Categoria 1], dDRE[Nível 2], dDRE[Nível 1], dDRE[Ordem] ) ),
                          ISINSCOPE(dDRE[Nível 2]), CALCULATE([Valor Orig Parc],ALLSELECTED( dDRE[Nível 2], dDRE[Nível 1], dDRE[Ordem] ) ),
                          ISINSCOPE(dDRE[Nível 1]), CALCULATE([Valor Orig Parc],ALLSELECTED( dDRE[Nível 1], dDRE[Ordem] ) ),
                          CALCULATE([Valor Orig Parc],ALLSELECTED(dDRE[Categoria 1], dDRE[Nível 2], dDRE[Nível 1], dDRE[Ordem] ) )

                        
                    ) 
RETURN DIVIDE(__Numerator, __Denominator) &lt;/LI-CODE&gt;
&lt;P&gt;This would be the result. My named the measure as [AV2] in the below matrix.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please be informed I used &amp;nbsp;&lt;SPAN&gt;[Valor Orig Parc] measure in the denominator if you want to use [&lt;/SPAN&gt;&lt;SPAN&gt;Valor Orig Parc Geral] then you can replace it in the demoinator variable. I am attaching the PBIX for your reference.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need a Power BI Consultation? Hire me on &lt;A href="https://bit.ly/4d3oy4s" target="_blank" rel="noopener"&gt;Upwork&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Connect on &lt;A href="https://www.linkedin.com/in/tharun-kumar-ravikrindhi/" target="_blank" rel="noopener"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class=""&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV style="border-radius: 1px; padding: 10px; border: solid #cccccc 1px; background: #fafafa no-repeat right 10px center;"&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG style="margin-right: 3px;"&gt;&lt;STRONG style="margin-right: 3px;"&gt;If I helped you, click on the Thumbs Up to give Kudos.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;
&lt;P style="padding: 0; margin: 5px 50px 0 0;"&gt;Proud to be a Super User!&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 17 Nov 2024 05:55:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287429#M170167</guid>
      <dc:creator>tharunkumarRTK</dc:creator>
      <dc:date>2024-11-17T05:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Vertical and Horizontal Analysis in percentages with 3 levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287670#M170186</link>
      <description>&lt;P&gt;Good morning!&lt;/P&gt;&lt;P&gt;Could we do a horizontal percentage analysis of a given month in relation to the previous month?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2024 14:31:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-do-Vertical-and-Horizontal-Analysis-in-percentages-with-3/m-p/4287670#M170186</guid>
      <dc:creator>carlosroston</dc:creator>
      <dc:date>2024-11-17T14:31:30Z</dc:date>
    </item>
  </channel>
</rss>

