<?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: Calculation between 2 tables with conditions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2900833#M94471</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;. I tested, but for what I want it doesn't work. I need to make the IF function see the specific fields that are been filtered. The entire column will give me a wrong Meta Alcançável.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 18:50:32 GMT</pubDate>
    <dc:creator>mottamatheus835</dc:creator>
    <dc:date>2022-11-11T18:50:32Z</dc:date>
    <item>
      <title>Calculation between 2 tables with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2890600#M93822</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;OLÁ,&lt;/P&gt;&lt;P&gt;Tenho o seguinte caso:&lt;/P&gt;&lt;P&gt;Tabela vendas:&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;Meta Alcançável&lt;/STRONG&gt; (é a o quanto da meta já deveria ter sido alcançado -- Meta / Dias úteis * Dias Passados)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;Dias Úteis&lt;/STRONG&gt;&amp;nbsp; (Medida calculada a partir de uma tabela data)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;Dias passados&lt;/STRONG&gt; (Medida -- Dias úteis - Dias úteis restantes )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tabela Lojas:&lt;/P&gt;&lt;P&gt;- Número da loja (chave da relação entre as tabelas)&lt;/P&gt;&lt;P&gt;- Abre final de semana (Sim ou Não)&lt;/P&gt;&lt;P&gt;Preciso fazer um cálculo da medida &lt;STRONG&gt;META ALCANÇÁVEL&lt;/STRONG&gt;, mas se caso um valor específico de outra tabela esteja sendo selecionado, o cálculo no visual leve em consideração outra condição de dias, isso porque nem todas as lojas abrem somente em dias úteis, mas sim todos os dias.&lt;/P&gt;&lt;P&gt;Por exemplo, tenho um gráfico de barras e no valor da &lt;STRONG&gt;META ALCANÇÁVEL&lt;/STRONG&gt; da LOJA X, que não abre final de semana e possui na tabela Lojas o campo &lt;STRONG&gt;ABRE FINAL DE SEMANA&lt;/STRONG&gt; como &lt;STRONG&gt;Sim&lt;/STRONG&gt;, o ideal seria em vez dos dias úteis o total de dias do mês atual e nos dias passados atuais do relatório.&amp;nbsp;&lt;/P&gt;&lt;P&gt;META ALCANÇÁVEL = META / TOTAL DE DIAS DO MÊS ATUAL * DIAS PASSADOS ATUAIS&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seguem os dados em Link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/1ohkzA_ocKKAbymZNCXtJ2q3nupCjXBo9?usp=sharing" target="_self" rel="nofollow noopener noreferrer"&gt;https://drive.google.com/drive/folders/1ohkzA_ocKKAbymZNCXtJ2q3nupCjXBo9?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exemplo de um resultado esperado:&lt;/P&gt;&lt;P&gt;No caso da Loja 5 uma das que abrem todos os dias, o cálculo seria:&lt;/P&gt;&lt;P&gt;Meta - R$350.000&lt;/P&gt;&lt;P&gt;Dias Úteis - 31 (Nesse caso são os totais de dias do mês de outubro)&lt;/P&gt;&lt;P&gt;Dias Passados - 24 (dia dessa mensagem, mas no cálculo seria uma função Today, provavelmente)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;META ALCANÇÁVEL = META / TOTAL DE DIAS DO MÊS ATUAL * DIAS PASSADOS ATUAIS&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;META ALCANÇÁVEL = 350.000/ 31 * 24&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;META ALCANÇÁVEL =&amp;nbsp;270967,74&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Nov 2022 00:34:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2890600#M93822</guid>
      <dc:creator>mottamatheus835</dc:creator>
      <dc:date>2022-11-08T00:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation between 2 tables with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2893961#M94011</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419873" data-lia-user-login="mottamatheus835" class="lia-mention lia-mention-user"&gt;mottamatheus835&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;You can add an if statement to your formula with isfiltered function to check if the specific field has been filtered. Then you can parameterized the calculation formula with the different expressions to achieve dynamic switch formulas based on filter effects.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://www.sqlbi.com/tv/isfiltered-iscrossfiltered-dax-guide/" target="_blank"&gt;ISFILTERED, ISCROSSFILTERED – DAX Guide - SQLBI&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 01:46:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2893961#M94011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-09T01:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation between 2 tables with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2900833#M94471</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;. I tested, but for what I want it doesn't work. I need to make the IF function see the specific fields that are been filtered. The entire column will give me a wrong Meta Alcançável.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 18:50:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2900833#M94471</guid>
      <dc:creator>mottamatheus835</dc:creator>
      <dc:date>2022-11-11T18:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation between 2 tables with conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2943963#M97329</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419873" data-lia-user-login="mottamatheus835" class="lia-mention lia-mention-user"&gt;mottamatheus835&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Can you please share the formula and expected result? They should help us clarify your scenario and test to coding formula.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:25:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-between-2-tables-with-conditions/m-p/2943963#M97329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-02T08:25:30Z</dc:date>
    </item>
  </channel>
</rss>

