<?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: Problem with my summarize table when I filter on category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186715#M115401</link>
    <description>&lt;P&gt;Again, that could be split across different shops. I don't see any differences between the code for the ins and for the outs, other than filtering on the in and out column from the Data table.&lt;/P&gt;
&lt;P&gt;I would check the source data to see which shops had the outs in a given week and then compare that to the summarized table.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 15:36:29 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-04-13T15:36:29Z</dc:date>
    <item>
      <title>Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186084#M115351</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So I have this Summarize table that show the number of IN and OUT per week :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Week&lt;/TD&gt;&lt;TD&gt;IN&lt;/TD&gt;&lt;TD&gt;OUT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2008-05&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;517&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;-4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2008-06&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;-153&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2008-07&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;-107&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;This table is create with this measure :&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Entrée/Sortie = 
VAR lastDataWeek =
    MAX ( Data[#Semaine de mesure] )
RETURN
    SUMMARIZE (
        ALL('Date_IN_OUT 1'),
        'Date_IN_OUT 1'[Semaine Entreprise],
        "Entrée", CALCULATE(SUM(Data[#Nombre entrée]),
                                FILTER(ALLSELECTED(Data),
                                Data[#Semaine entrée entreprise] = 'Date_IN_OUT 1'[Semaine Entreprise] &amp;amp;&amp;amp; Data[#Semaine de mesure]==lastDataWeek)),
        "Sortie",CALCULATE(SUM(Data[#Nombre sortie]),
 
        FILTER(ALLSELECTED(Data),Data[#Semaine sortie entreprise] = 'Date_IN_OUT 1'[Semaine Entreprise] &amp;amp;&amp;amp; Data[#Semaine de mesure] == lastDataWeek))
                    
            )&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And it's work well until I want to make a filter on a shop that's the result :&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Week&lt;/TD&gt;&lt;TD&gt;Shop&lt;/TD&gt;&lt;TD&gt;Entrée&lt;/TD&gt;&lt;TD&gt;Sortie&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD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lt;LI-CODE lang="markup"&gt;Entrée/Sortie = 
VAR lastDataWeek =
    MAX ( Data[#Semaine de mesure] )
RETURN
    SUMMARIZE (
        ALL('Data'),
        'Date_IN_OUT 1'[Semaine Entreprise],
        Data[#Nom complet magasin],
        "Entrée", CALCULATE(SUM(Data[#Nombre entrée]),
                                FILTER(ALLSELECTED(Data),
                                Data[#Semaine entrée entreprise] = 'Date_IN_OUT 1'[Semaine Entreprise] &amp;amp;&amp;amp; Data[#Semaine de mesure]==lastDataWeek)),
        "Sortie",CALCULATE(SUM(Data[#Nombre sortie]),
 
        FILTER(ALLSELECTED(Data),Data[#Semaine sortie entreprise] = 'Date_IN_OUT 1'[Semaine Entreprise] &amp;amp;&amp;amp; Data[#Semaine de mesure] == lastDataWeek))
            )&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My fact table is "Data" and my date Table is "Date_IN_OUT".&lt;BR /&gt;It's been a long time that I'm blocked on this someone can help me please.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 11:04:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186084#M115351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-13T11:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186592#M115391</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Entrée/Sortie =
VAR lastDataWeek =
    MAX ( Data[#Semaine de mesure] )
RETURN
    ADDCOLUMNS (
        SUMMARIZE (
            'Data',
            'Date_IN_OUT 1'[Semaine Entreprise],
            Data[#Nom complet magasin]
        ),
        "Entrée",
            VAR Entreprise = 'Date_IN_OUT 1'[Semaine Entreprise]
            RETURN
                CALCULATE (
                    SUM ( Data[#Nombre entrée] ),
                    Data[#Semaine entrée entreprise] = Entreprise
                        &amp;amp;&amp;amp; Data[#Semaine de mesure] == lastDataWeek
                ),
        "Sortie",
            VAR Entreprise = 'Date_IN_OUT 1'[Semaine Entreprise]
            RETURN
                CALCULATE (
                    SUM ( Data[#Nombre sortie] ),
                    Data[#Semaine sortie entreprise] = Entreprise
                        &amp;amp;&amp;amp; Data[#Semaine de mesure] == lastDataWeek
                )
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:55:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186592#M115391</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-04-13T14:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186633#M115396</link>
      <description>&lt;P&gt;Thanks for your response.&lt;BR /&gt;It's work for IN column but not for OUT column:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:11:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186633#M115396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-13T15:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186672#M115398</link>
      <description>&lt;P&gt;Are you sure that there is OUT data for the other shops? The -4 which it put into the first shop matches the figure for the total number of outs which was produced by your previous code&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:19:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186672#M115398</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-04-13T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186696#M115400</link>
      <description>&lt;P&gt;For this case yes but for the week 6 of year 2008 this is not the good result we have 0 out :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Whereas in other data without filter they have -153 OUT :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:26:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186696#M115400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-13T15:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186715#M115401</link>
      <description>&lt;P&gt;Again, that could be split across different shops. I don't see any differences between the code for the ins and for the outs, other than filtering on the in and out column from the Data table.&lt;/P&gt;
&lt;P&gt;I would check the source data to see which shops had the outs in a given week and then compare that to the summarized table.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186715#M115401</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-04-13T15:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186996#M115427</link>
      <description>&lt;P&gt;I couldn't send the data.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:46:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3186996#M115427</guid>
      <dc:creator>Imad-R</dc:creator>
      <dc:date>2023-04-13T17:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3187274#M115451</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;Entrée/Sortie =&lt;BR /&gt;VAR T =&lt;BR /&gt;ALL ( 'Data' )&lt;BR /&gt;RETURN&lt;BR /&gt;GENERATE (&lt;BR /&gt;SUMMARIZE ( T, 'Date_IN_OUT 1'[Semaine Entreprise], Data[#Nom complet magasin] ),&lt;BR /&gt;VAR lastDataWeek =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( Data[#Semaine de mesure] ),&lt;BR /&gt;ALL ( Data[#Nom complet magasin] )&lt;BR /&gt;)&lt;BR /&gt;VAR Entree =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Data[#Nombre entrée] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;T,&lt;BR /&gt;Data[#Semaine entree entreprise] = 'Date_IN_OUT 1'[Semaine Entreprise]&lt;BR /&gt;&amp;amp;&amp;amp; Data[#Semaine de mesure] == lastDataWeek&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;VAR Sortie =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Data[#Nombre sortie] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;T,&lt;BR /&gt;Data[#Semaine sortie entreprise] = 'Date_IN_OUT 1'[Semaine Entreprise]&lt;BR /&gt;&amp;amp;&amp;amp; Data[#Semaine de mesure] == lastDataWeek&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;ROW ( "Entrée", Entree, "Sortie", Sortie )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 21:50:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3187274#M115451</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-13T21:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my summarize table when I filter on category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3197418#M116123</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;For it to work well, il's necessary that it's appear -153 for 2008-06 week because this week is represented by one shop and this isn't the case.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 07:58:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-my-summarize-table-when-I-filter-on-category/m-p/3197418#M116123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-20T07:58:41Z</dc:date>
    </item>
  </channel>
</rss>

