<?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 TREATAS filter propagation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2190554#M51189</link>
    <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;Given the following data model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I would like to create a measure that would aggregate an attribute from the table [ServiceCases]. The design should allow me also to slice [ServiceCases] table using [SalesInvoiceDate] time table.&lt;BR /&gt;&lt;BR /&gt;This is the initial code I created:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Some fee = 
CALCULATE(
    [# ServiceCases], -- COUNTROWS(ServiceCases)
        USERELATIONSHIP(SalesInvoiceDate[SalesInvoiceDate],SalesOrder[InvoiceDate]), -- to activate the relationship
        TREATAS(values(ServiceCases[RelatedDocumentNo]),SalesOrder[InternDocumentNumber]) -- to map one table into another)
    )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Unfortunately, when I put attributes and the measure I'm interested in, I get record multuplication:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain to me this strange behaviour?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Nov 2021 15:02:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-15T15:02:42Z</dc:date>
    <item>
      <title>TREATAS filter propagation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2190554#M51189</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;Given the following data model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I would like to create a measure that would aggregate an attribute from the table [ServiceCases]. The design should allow me also to slice [ServiceCases] table using [SalesInvoiceDate] time table.&lt;BR /&gt;&lt;BR /&gt;This is the initial code I created:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Some fee = 
CALCULATE(
    [# ServiceCases], -- COUNTROWS(ServiceCases)
        USERELATIONSHIP(SalesInvoiceDate[SalesInvoiceDate],SalesOrder[InvoiceDate]), -- to activate the relationship
        TREATAS(values(ServiceCases[RelatedDocumentNo]),SalesOrder[InternDocumentNumber]) -- to map one table into another)
    )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Unfortunately, when I put attributes and the measure I'm interested in, I get record multuplication:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain to me this strange behaviour?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 15:02:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2190554#M51189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-15T15:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS filter propagation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2190751#M51208</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; can you try this instead&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some fee = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[# ServiceCases], -- COUNTROWS(ServiceCases)&lt;BR /&gt;USERELATIONSHIP(SalesInvoiceDate[SalesInvoiceDate],SalesOrder[InvoiceDate]), -- to activate the relationship&lt;BR /&gt;TREATAS(values(&lt;STRONG&gt;SalesOrder[InternDocumentNumber]&lt;/STRONG&gt;),&lt;STRONG&gt;ServiceCases[RelatedDocumentNo]&lt;/STRONG&gt;) -- to map one table into another)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 16:57:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2190751#M51208</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-15T16:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS filter propagation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2191814#M51259</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;The value for metric [Some fee] actually changed, but it's still a total spread across all the lines, w/o the slice I'm looking for, so it doesn't solve the issue.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 06:50:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2191814#M51259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-16T06:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS filter propagation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2193169#M51303</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; I tested out with the following model and it is giving me what was desired&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| SalesInvoice     |
|------------------|
| SalesInvoiceDate |
|------------------|
| 2021-01-01       |
| 2021-01-02       |
| 2021-01-03       |


|            SalesOrder           |
|-------------|------|------------|
| InvoiceDate | Doc# | Date       |
|-------------|------|------------|
| 2021-01-01  | 123  | 2021-01-01 |
| 2021-01-02  | 231  | 2021-01-02 |
| 2021-01-03  | 312  | 2021-01-03 |
| 2021-01-01  | 456  | 2021-01-01 |
| 2021-01-02  | 567  | 2021-01-02 |
| 2021-01-03  | 789  | 2021-01-03 |

| ServiceCases |
|--------------|
| Docu#        |
|--------------|
| 456          |
| 456          |
| 789          |
| 456          |
| 789          |
| 1000         |
| 2000         |&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pbix is attached&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are experiencing a different behaviour, can you please post the pbix here?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 19:40:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2193169#M51303</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-16T19:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS filter propagation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2195758#M51422</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;；&lt;/P&gt;
&lt;P&gt;I tested by simple data ,and you could try it .&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Some fee =
VAR _id =
    SUMMARIZE (
        FILTER (
            ALL ( 'SalesOrder' ),
            'SalesOrder'[InvoiceDate] = MAX ( 'SalesOrder'[InvoiceDate] )
        ),
        [InternDocumentNumber]
    )
RETURN
    CALCULATE (
        COUNTROWS (
            FILTER ( ALL ( 'ServiceCases' ), 'ServiceCases'[RelatedDocumentNo] IN _id )
        ),
        USERELATIONSHIP ( 'SalesInvoice'[SalesInvoiceDate], 'SalesOrder'[InvoiceDate] )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The final output is shown below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If not right, can you tell the result what you want output in my simple data or change the simple data to similar with yours?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Community Support Team_ Yalan Wu&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt; &lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 04:51:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2195758#M51422</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2021-11-18T04:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS filter propagation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2205021#M51857</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;Best Regards,&lt;/DIV&gt;
&lt;DIV&gt;Community Support Team_ Yalan Wu&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;helps&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 05:47:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-filter-propagation/m-p/2205021#M51857</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2021-11-24T05:47:30Z</dc:date>
    </item>
  </channel>
</rss>

