<?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: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028208#M159143</link>
    <description>&lt;P&gt;&lt;FONT&gt;Hello&amp;nbsp;&lt;/FONT&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;&lt;FONT&gt;&lt;FONT&gt;&amp;nbsp;,&amp;nbsp;&lt;/FONT&gt;&lt;FONT&gt;remember to adhere to the decorum of the Community Forum when asking a question.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;Please show the expected outcome based on the sample data you provided.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jul 2024 17:13:22 GMT</pubDate>
    <dc:creator>foodd</dc:creator>
    <dc:date>2024-07-06T17:13:22Z</dc:date>
    <item>
      <title>Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028205#M159141</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;FONT&gt;&lt;FONT&gt;Olá!&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;FONT&gt;&lt;FONT&gt;Gostaria de calcular a porcentagem do nível da loja e não estou conseguindo. O resultado atualmente aparece 100% mas eu gostaria que aparecesse o % da Loja em relação ao total geral conforme mostrado em uma das imagens abaixo. Poderiam me ajudar por favor?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;FONT&gt;&lt;FONT&gt;A fórmula que precisa alterar é esta:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;% Valor Total (LCP) =&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VAR todos os produtos =&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;ALLSELECTED(dProduto)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VAR produtosnaloja = &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;CALCULATETABLE( &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;dProduto,&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;todos os produtos,&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VALUES(dLoja[Nome da Loja]) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VAR produtosnacategoria = &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;CALCULATETABLE( &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;dProduto,&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;produtosnaloja,&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VALUES(dProduto[Categoria do Produto]) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VAR numerador = [Valor Total]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VAR denominador = &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;SWITCH( &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;[Níveis],&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Loja", CALCULATE([Valor Total], todos os produtos),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Categoria", CALCULATE([Valor Total], produtosnaloja),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Produto", CALCULATE([Valor Total], produtosnacategoria) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;VAR Resultado = &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;DIVIDE( &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;numerador,&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;denominador &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;RETORNAR&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT&gt;&lt;FONT&gt;Resultado&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;FONT&gt;&lt;FONT&gt;A fórmula que aparece o resultado que quero inserir é essa:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;% Valor Total = &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;CALCULATE &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;( &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;DIVIDIR &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;( &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;[Valor Total] &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;[Valor Total Geral]))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&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;</description>
      <pubDate>Sat, 06 Jul 2024 17:04:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028205#M159141</guid>
      <dc:creator>carlosroston</dc:creator>
      <dc:date>2024-07-06T17:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028207#M159142</link>
      <description>&lt;P&gt;Informational reply containing Spanish to English translation:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Hello!

 

I'd like to calculate the store level percentage and I'm not getting it. The result currently shows 100%, but I'd like it to show the % of the Store in relation to the grand total, as shown in one of the images below. Could you help me please?

 

The formula you need to change is this:

% Total Value (LCP) =
VAR all products = ALLSELECTED(dProduct)
VAR productsinstore = CALCULATETABLE( dProduct, all products, VALUES(dStore[Store Name]) ) )
VAR productsin category = CALCULATETABLE( dProduct, productsinstore, VALUES(dProduct[Product Category]) )
VAR numerator = [Total Value]
VAR denominator = SWITCH( [Levels],
"Store", CALCULATE([Total Value], all products),
"Category", CALCULATE([Total Value], productsin-store),
"Product", CALCULATE([Total Value], productsincategory) )
VAR Result = DIVIDE( numerator, denominator )
RETURN Result
 

The formula that shows the result I want to enter is this:

% Total Value = CALCULATE ( DIVIDE ( [Total Value] , [Grand Total Value]))&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 06 Jul 2024 17:12:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028207#M159142</guid>
      <dc:creator>foodd</dc:creator>
      <dc:date>2024-07-06T17:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028208#M159143</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hello&amp;nbsp;&lt;/FONT&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;&lt;FONT&gt;&lt;FONT&gt;&amp;nbsp;,&amp;nbsp;&lt;/FONT&gt;&lt;FONT&gt;remember to adhere to the decorum of the Community Forum when asking a question.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;Please show the expected outcome based on the sample data you provided.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2024 17:13:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4028208#M159143</guid>
      <dc:creator>foodd</dc:creator>
      <dc:date>2024-07-06T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4033850#M159714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="89602" data-lia-user-login="foodd" class="lia-mention lia-mention-user"&gt;foodd&lt;/a&gt;&amp;nbsp;,thanks for the quick reply, I'll add more.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&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;When I click on the link you provided, it prompts me to request access.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Wenbin Zhou&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 06:50:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4033850#M159714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-10T06:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4040638#M160219</link>
      <description>&lt;P&gt;Could you please check if the link is working again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1-NOQKDXK_qCE7C1__97Snk83BiRNpakC/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1-NOQKDXK_qCE7C1__97Snk83BiRNpakC/view?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2024 15:08:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4040638#M160219</guid>
      <dc:creator>carlosroston</dc:creator>
      <dc:date>2024-07-13T15:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4041434#M160245</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&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;If I understand correctly, this is your expected result?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can use the 'ISINSCOPE' function to determine the hierarchy.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/isinscope-function-dax" target="_blank"&gt;ISINSCOPE function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% Valor Total (LCP) = 
VAR _isShop = 
ISINSCOPE('dProduto'[Categoria do Produto])
VAR allprodutos = 
ALLSELECTED(dProduto)

VAR produtosnaloja = 
CALCULATETABLE(
    dProduto,
    allprodutos,
    VALUES(dLoja[Nome da Loja])
)

VAR produtosnacategoria = 
CALCULATETABLE(
    dProduto,
    produtosnaloja,
    VALUES(dProduto[Categoria do Produto])
)

VAR numerador = [Valor Total]
VAR denominador = 
SWITCH(
    [Níveis],
    "Loja", CALCULATE([Valor Total], allprodutos),
    "Categoria", CALCULATE([Valor Total], produtosnaloja),
    "Produto", CALCULATE([Valor Total], produtosnacategoria)
)

VAR Result = 
DIVIDE(
    numerador,
    denominador
)
RETURN
IF(NOT _isShop ,
[% Valor Total],
Result
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Wenbin Zhou&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 03:01:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4041434#M160245</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-15T03:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Como calcular a porcentagem a nível de loja (níveis: loja, categoria e produto)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4057073#M161016</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;FONT&gt;Perfeito&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;perfeito. Meu amigo muitíssimo obrigado.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 17:47:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Como-calcular-a-porcentagem-a-n%C3%ADvel-de-loja-n%C3%ADveis-loja/m-p/4057073#M161016</guid>
      <dc:creator>carlosroston</dc:creator>
      <dc:date>2024-07-23T17:47:18Z</dc:date>
    </item>
  </channel>
</rss>

