<?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: Calcular suma quitando valores duplicados in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2992945#M100752</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See it all at work in the attached file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Días3 V2 = 
VAR relevant_ = { "227", "922", "976", "980" }
VAR auxT_ =
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER ( TABLE3, TABLE3[CO_TMENSAJE] IN relevant_ ),
            TABLE3[CO_TMENSAJE],
            [CO_DIALOGO_LES]
        ),
        "@Res", CALCULATE ( MIN ( TABLE3[Dias LIQ tramitacion] ) )
    )
RETURN
    SUMX ( auxT_, [@Res] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Dec 2022 08:38:09 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2022-12-29T08:38:09Z</dc:date>
    <item>
      <title>Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2986827#M100269</link>
      <description>&lt;P&gt;Buenas tardes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tengo una consulta a la hora de calcular un dato.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tengo una tabla con número de expedientes(referencias) estos expedientes no son únicos ya que llevan unos códigos de mensaje. Cada código de mensaje es un registro con su expediente.&lt;/P&gt;&lt;P&gt;He creado una columna en la cual me calcula la diferencia en días desde el alta del expediente a la fecha de envío del mensaje (con su código).&lt;/P&gt;&lt;P&gt;Necesitaría calcular la suma de los días totales para 4 códigos expecíficos. (los códigos serían 922,976,227 y 980) si estos códigos se repitieran tendría que coger el primero (sería el valor mínimo en días desde el alta. (por ejemplo puedo tener dos registros con el código 922 uno con 9 días y otro con 18 debería tener en cuenta solo el de los 9 días.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;La finalidad es calcular una media de cuantos días se tarda desde el alta del expediente hasta la emisión de uno de esos códigos.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 17:00:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2986827#M100269</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-23T17:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2986943#M100280</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show some sample data and the expected result?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 20:30:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2986943#M100280</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-23T20:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987153#M100304</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hay que calcular la media de los días con Las comunicaciones de la tabla CO_TMENSAJE922, 976, 227 y 980. y si CO_DIALOGO_LES está duplicado con esos mensajes cojer el que menor LIQ_dias tramitación&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 20:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987153#M100304</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-23T20:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987189#M100306</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks. That helps.&lt;/P&gt;
&lt;P&gt;If you can paste the table here in text-tabular format instead of on a screen capture, I can build it for you &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 20:35:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987189#M100306</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-23T20:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987491#M100335</link>
      <description>&lt;P&gt;CO_DIALOGO_LES FEC_ALTA_LES CO_TMENSAJE FE_ENVIO Dias LIQ tramitacion&lt;BR /&gt;202280014504 13/10/2022 202 23/10/2022 10&lt;BR /&gt;202280014550 17/10/2022 922 27/10/2022 10&lt;BR /&gt;202280014684 20/10/2022 976 30/10/2022 10&lt;BR /&gt;202280014634 19/10/2022 227 07/11/2022 19&lt;BR /&gt;202280014684 20/10/2022 922 07/11/2022 18&lt;BR /&gt;202280014550 21/11/2022 922 15/12/2022 24&lt;BR /&gt;202280015572 21/11/2022 922 15/12/2022 24&lt;BR /&gt;202280015824 30/11/2022 922 10/12/2022 10&lt;BR /&gt;202280015866 01/12/2022 227 11/12/2022 10&lt;BR /&gt;202280015955 05/12/2022 922 17/12/2022 12&lt;BR /&gt;202180002110 21/06/2021 227 15/07/2021 24&lt;BR /&gt;202180002478 12/07/2021 202 22/07/2021 10&lt;BR /&gt;202180002875 02/08/2021 202 12/08/2021 10&lt;BR /&gt;202180003346 20/08/2021 202 30/08/2021 10&lt;BR /&gt;202180003347 20/08/2021 922 15/09/2021 26&lt;BR /&gt;202180003348 20/08/2021 202 30/08/2021 10&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 09:07:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987491#M100335</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-24T09:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987496#M100338</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this for [Días]&lt;/P&gt;
&lt;P&gt;Note we are hard-coding the relevant values for Table1[CO_TMENSAJE]. Another option, potentially better depending on your requirements, would be to set these in a slicer&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Días = 
VAR relevant_ = { 227, 922, 976, 980 }
VAR auxT_ =
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER ( Table1, Table1[CO_TMENSAJE] IN relevant_ ),
            [CO_DIALOGO_LES]
        ),
        "@Res", CALCULATE ( MIN ( Table1[Dias LIQ tramitacion] ) )
    )
RETURN
    SUMX ( auxT_, [@Res] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 09:37:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987496#M100338</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T09:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987498#M100340</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And similarly for [Total expt]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total expt = 
VAR relevant_ = { 227, 922, 976, 980 }
VAR auxT_ =
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER ( Table1, Table1[CO_TMENSAJE] IN relevant_ ),
            [CO_DIALOGO_LES]
        ),
        "@Res", CALCULATE ( MIN ( Table1[Dias LIQ tramitacion] ) )
    )
RETURN
    COUNTX ( auxT_, [@Res] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then [Resultado] uses the two previous measures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Resultado = 
DIVIDE([Días], [Total expt])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;See it all at work in the attached file&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 09:43:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987498#M100340</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T09:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987506#M100344</link>
      <description>&lt;P&gt;No me da el resultado esperado..&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 10:09:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987506#M100344</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-24T10:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987507#M100345</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The file attached in my previous post yields exactly the expected result that you showed above.&lt;/P&gt;
&lt;P&gt;What is the difference?&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 10:43:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2987507#M100345</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T10:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2988177#M100411</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count =
var _1=
COUNTX(FILTER(ALL('CO_TMENSAJE922-976-227-980'),
'CO_TMENSAJE922-976-227-980'[CO_DIALOGO_LES]=EARLIER('CO_TMENSAJE922-976-227-980'[CO_DIALOGO_LES])),[Dias LIQ tramitacion])
var _dias=
MINX(FILTER(ALL('CO_TMENSAJE922-976-227-980'),'CO_TMENSAJE922-976-227-980'[CO_DIALOGO_LES]=EARLIER('CO_TMENSAJE922-976-227-980'[CO_DIALOGO_LES])),[Dias LIQ tramitacion])
return
IF(
    _1=1,_1,
    IF(
    _1=2&amp;amp;&amp;amp;'CO_TMENSAJE922-976-227-980'[Dias LIQ tramitacion]=_dias,1,_1)
)&lt;/LI-CODE&gt;
&lt;P&gt;2. Enter data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create calculated column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result =
var _tabel1=FILTER('CO_TMENSAJE922-976-227-980','CO_TMENSAJE922-976-227-980'[CO_TMENSAJE] in {922,976,227,980} &amp;amp;&amp;amp; [Count]=1)
return
SWITCH(
    TRUE(),
'Flag_Table'[Flag]="dias",SUMX(_tabel1,[Dias LIQ tramitacion]),
'Flag_Table'[Flag]="total expt",COUNTX(_tabel1,[Dias LIQ tramitacion]),
'Flag_Table'[Flag]="resultado",AVERAGEX(_tabel1,[Dias LIQ tramitacion])
)&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 03:05:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2988177#M100411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-26T03:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2988647#M100443</link>
      <description>&lt;P&gt;No me vale la solución ya que cada expediente tiene varios códigos Tmensaje, en la tabla solo puse una muestra.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 10:04:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2988647#M100443</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-26T10:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2988650#M100444</link>
      <description>&lt;P&gt;Al trasladar la fórmula dax a mi modelo me dan los días negativos. El campo Tmensaje lo tengo definido como si texo. No se si es ahí el error.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 10:05:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2988650#M100444</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-26T10:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2989839#M100540</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Link does not work&lt;/P&gt;
&lt;P&gt;I haven't&amp;nbsp;understood what the problem is with the previous version of the code. You can either explain it better or adapt the code provided yourself&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 09:45:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2989839#M100540</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-27T09:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2989866#M100542</link>
      <description>&lt;P&gt;Pongo de nuevo el ejemplo solicitando vuestra ayuda.&lt;/P&gt;&lt;P&gt;Solo necesitaría calcular la suma de la columna dias liq tramitación teniendo en cuenta lo siguiente:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;El valor tiene que ser el menor de entre dialogo_les y las comunicaciones 922,976,227 y 980.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;solo se debe cojer el valor inferior para cada dialogo_les de una de esos 4 tmensajes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Resultado experado serían 7 expedientes_les y 261 días.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CO_COMUNICACION CO_EXP CO_TMENSAJE CO_DIALOGO_LES FEC_ALTA_LES Dias LIQ tramitacion&lt;BR /&gt;1362 202180000025 980 202180000026 19/01/2021 42&lt;BR /&gt;394 202180000029 980 202180000030 19/01/2021 21&lt;BR /&gt;4983 202180000033 227 202180000034 20/01/2021 90&lt;BR /&gt;3762 202180000033 980 202180000034 20/01/2021 79&lt;BR /&gt;1063 202180000033 980 202180000034 20/01/2021 35&lt;BR /&gt;2504 202180000035 980 202180000036 20/01/2021 63&lt;BR /&gt;3000 202180000038 980 202180000039 20/01/2021 68&lt;BR /&gt;14403 202180000038 977 202180000039 20/01/2021 147&lt;BR /&gt;11120 202180000038 201 202180000039 20/01/2021 128&lt;BR /&gt;1272 202180000047 922 202180000048 22/01/2021 38&lt;BR /&gt;1014 202180000047 201 202180000048 22/01/2021 32&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 10:01:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2989866#M100542</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-27T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2990152#M100575</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the &lt;STRONG&gt;same measures&lt;/STRONG&gt; as before and they are still working on this data. Not sure what you did earlier, probably did not copy/paste correctly. &amp;nbsp;&lt;STRONG&gt;See it all at work in the attached file&lt;/STRONG&gt;, Page 2. Note the new table is Table2. Table1 is what we had from the previous go.&lt;/P&gt;
&lt;P&gt;I am copying the new measures here again but, like just mentioned, do note the only thing that changes is that they operate in Table2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's 6 "expedientes", not 7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Días2 = 
VAR relevant_ = { 227, 922, 976, 980 }
VAR auxT_ =
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER ( Table2, Table2[CO_TMENSAJE] IN relevant_ ),
            [CO_DIALOGO_LES]
        ),
        "@Res", CALCULATE ( MIN ( Table2[Dias LIQ tramitacion] ) )
    )
RETURN
    SUMX ( auxT_, [@Res] )&lt;/LI-CODE&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;
&lt;LI-CODE lang="markup"&gt;Total expt2 = 
VAR relevant_ = { 227, 922, 976, 980 }
VAR auxT_ =
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER ( Table2, Table2[CO_TMENSAJE] IN relevant_ ),
            [CO_DIALOGO_LES]
        ),
        "@Res", CALCULATE ( MIN ( Table2[Dias LIQ tramitacion] ) )
    )
RETURN
    COUNTX ( auxT_, [@Res] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 12:41:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2990152#M100575</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-27T12:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2991627#M100672</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;Adjunto el fichero con la tabla y todos los datos junto con tu código. Como puedes ver el resultado es -23 cuando el resultado esperado sería 288859&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;La función me coje solo los días negativos y al resto de registros los marca como 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;¿Puedes ayudarme?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1JC6kvNRW7NjXIZdUp5fxT8jGQBHW2vOF/view?usp=share_link&amp;nbsp;&amp;nbsp;" target="_self"&gt;https://drive.google.com/file/d/1JC6kvNRW7NjXIZdUp5fxT8jGQBHW2vOF/view?usp=share_link&amp;nbsp;&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Dec 2022 11:59:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2991627#M100672</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-30T11:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2992945#M100752</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490752" data-lia-user-login="Gaspar89" class="lia-mention lia-mention-user"&gt;Gaspar89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See it all at work in the attached file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Días3 V2 = 
VAR relevant_ = { "227", "922", "976", "980" }
VAR auxT_ =
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER ( TABLE3, TABLE3[CO_TMENSAJE] IN relevant_ ),
            TABLE3[CO_TMENSAJE],
            [CO_DIALOGO_LES]
        ),
        "@Res", CALCULATE ( MIN ( TABLE3[Dias LIQ tramitacion] ) )
    )
RETURN
    SUMX ( auxT_, [@Res] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 08:38:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2992945#M100752</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-29T08:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular suma quitando valores duplicados</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2994779#M100870</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;No me sigue saliendo el resultado esperado..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Me está sumando todos los "Dias LIQ tramitacion" que contienen los CO_TMENSAJE "922, 976, 227 y 980.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cada CO_DIALOGO_LES puede tener alguno o varios de esos Co_tmensaje hay seleccionar el menor valor tenga en dias liq tramitación de cualquiera de esos cuatro mensajes por cada expediente.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;La lógica es calcular el menor valor para cada expediente de cada uno de esos mensajes y sumarlo. En total tendría que sumar 7720 registros que deben ser el menor de cualquiera de esos cuato co_tmensaje.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;El resultado esperado son 288859&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 11:59:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcular-suma-quitando-valores-duplicados/m-p/2994779#M100870</guid>
      <dc:creator>Gaspar89</dc:creator>
      <dc:date>2022-12-30T11:59:20Z</dc:date>
    </item>
  </channel>
</rss>

