<?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: FILTER inside CONCATENATEX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2317373#M57771</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="356598" data-lia-user-login="CarlaTP" class="lia-mention lia-mention-user"&gt;CarlaTP&lt;/a&gt; , something like this &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;concatenateX( &lt;BR /&gt;ADDCOLUMNS( Summarize (calculatetable(Episodes, KEEPFILTERS (&lt;BR /&gt;TREATAS (&lt;BR /&gt;{&lt;BR /&gt;1&lt;BR /&gt;},&lt;BR /&gt;CalendarRequested[Is Same As Today]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;FILTER (&lt;BR /&gt;CalendarRequested,&lt;BR /&gt;CalendarRequested[Date]&lt;BR /&gt;IN DATESINPERIOD (&lt;BR /&gt;CalendarRequested[Date],&lt;BR /&gt;TODAY (),&lt;BR /&gt;-85,&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)) ,&lt;BR /&gt;Episodes[Doctor],&lt;BR /&gt;Episodes[Location]),&lt;BR /&gt;&lt;BR /&gt;"Seen In Three", DISTINCTCOUNT(Episodes[Requested] )&lt;BR /&gt;) ,[Doctor])&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 09:55:50 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-02-03T09:55:50Z</dc:date>
    <item>
      <title>FILTER inside CONCATENATEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2317341#M57768</link>
      <description>&lt;P&gt;I'm new to Power Bi/DAX and having trouble getting my head around connecting some measures together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm displaying which doctors operate at which hospitals today, according to a 4 week roster. All determined by when we have seen them in the past (each record is called an Episode). I have a Boolean in my Calendar table called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Is Same As Today&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;which my visual is filtered by.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each Hospital I show the list of doctors with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List of Doctors = 
    CONCATENATEX(
        VALUES('Episodes'[Doctor]),
        'Episodes'[Doctor],
        ", ",
        'Episodes'[Doctor],
        ASC
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do, is filter the values that go into the above CONCATENATEX so that we only see Doctors who were seen at least 2 times in the last 3 relevant dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this code with the help of DAX Studio, it gives the number of times the doctor was seen on the appropriate day in the last 12 weeks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Seen In Three = 
SUMMARIZECOLUMNS (
    Episodes[Doctor],
    Episodes[Location],
    KEEPFILTERS (
        TREATAS (
            {
                1
            },
            CalendarRequested[Is Same As Today]
        )
    ),
    FILTER (
        CalendarRequested,
        CalendarRequested[Date]
            IN DATESINPERIOD (
                CalendarRequested[Date],
                TODAY (),
                -85,
                DAY
            )
    ),
    "Seen In Three", DISTINCTCOUNT(Episodes[Requested] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I connect these two so that CONCATENATEX checks if&amp;nbsp;&lt;/SPAN&gt;Seen In Three&lt;SPAN&gt;&amp;nbsp;is &amp;gt; 1?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 09:40:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2317341#M57768</guid>
      <dc:creator>CarlaTP</dc:creator>
      <dc:date>2022-02-03T09:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER inside CONCATENATEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2317373#M57771</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="356598" data-lia-user-login="CarlaTP" class="lia-mention lia-mention-user"&gt;CarlaTP&lt;/a&gt; , something like this &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;concatenateX( &lt;BR /&gt;ADDCOLUMNS( Summarize (calculatetable(Episodes, KEEPFILTERS (&lt;BR /&gt;TREATAS (&lt;BR /&gt;{&lt;BR /&gt;1&lt;BR /&gt;},&lt;BR /&gt;CalendarRequested[Is Same As Today]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;FILTER (&lt;BR /&gt;CalendarRequested,&lt;BR /&gt;CalendarRequested[Date]&lt;BR /&gt;IN DATESINPERIOD (&lt;BR /&gt;CalendarRequested[Date],&lt;BR /&gt;TODAY (),&lt;BR /&gt;-85,&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)) ,&lt;BR /&gt;Episodes[Doctor],&lt;BR /&gt;Episodes[Location]),&lt;BR /&gt;&lt;BR /&gt;"Seen In Three", DISTINCTCOUNT(Episodes[Requested] )&lt;BR /&gt;) ,[Doctor])&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 09:55:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2317373#M57771</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-03T09:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER inside CONCATENATEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2318907#M57872</link>
      <description>&lt;P&gt;EDIT: Turns out it wasn't working perfectly, many attempts later and i have it fixed. Had to remove the ADDCOLUMNS and move the DISTINCTCOUNT into the SUMMARIZE. Changed the code below to show final working answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much! I chucked the whole thing into a filter and it works perfectly now.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List of Doctors = 
    CONCATENATEX (
        FILTER (
            SUMMARIZE (
                CALCULATETABLE (
                    Episodes,
                    KEEPFILTERS (
                        TREATAS (
                            {
                                1
                            },
                            CalendarRequested[Is Same As Today]
                        )
                    ),
                    KEEPFILTERS (
                        TREATAS (
                            DATESINPERIOD (
                                CalendarRequested[Date],
                                TODAY (),
                                -85,
                                DAY
                            ),
                            CalendarRequested[Date]
                        )
                    )
                ),
                Episodes[Doctor],
                Episodes[Location],
                "Seen In Three", DISTINCTCOUNT ( Episodes[Requested] )
            ),
            [Seen In Three] &amp;gt; 1
        ),
        [Doctor],
        ", ",
        [Doctor]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 08:45:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-inside-CONCATENATEX/m-p/2318907#M57872</guid>
      <dc:creator>CarlaTP</dc:creator>
      <dc:date>2022-02-04T08:45:11Z</dc:date>
    </item>
  </channel>
</rss>

