<?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 tables without relationships in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1172435#M18112</link>
    <description>&lt;P&gt;I'm not sure I understand what you need well but It looks like you don't want to filter your source and destination tables manually. But you want to get them filtered based on a filter applied to ProdStep1 table.&lt;BR /&gt;&lt;BR /&gt;Then you probably don't need Source and Destination tables at all. Use your ProdStep* tables.&lt;BR /&gt;&lt;BR /&gt;Let's say you have a filter applied to&amp;nbsp;ProdStep1 table. And it has relationships with&amp;nbsp;ProdStep2 and&amp;nbsp;ProdStep3 and&amp;nbsp;ProdStep4. So these 3 tables are fltered by the filter applied to&amp;nbsp;ProdStep1.&amp;nbsp; I will use only 3 tables in my example:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;My 'All Products' table has 2 columns and (distinct number of products) * (distinct number of products) rows (10K rows for 100 products). For each ID in Column 1 there is a list of all IDs in Column 2.&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Now this measure:&lt;BR /&gt;&lt;BR /&gt;&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;Measure := 
VAR _source =
    SELECTEDVALUE ( 'All Products'[Column1] )
VAR _destination =
    SELECTEDVALUE ( 'All Products'[Column2] )
RETURN
    IF (
        AND (
            _source IN VALUES ( Table01[Column1] ),
            _destination
                IN SELECTCOLUMNS (
                    FILTER ( Table02, Table02[Column2] = _source ),
                    "id", Table02[Column1]
                )
        )
            || AND (
                _source IN VALUES ( Table02[Column1] ),
                _destination
                    IN SELECTCOLUMNS (
                        FILTER ( Table03, Table03[Column2] = _source ),
                        "id", Table03[Column1]
                    )
            ),
        1,
        BLANK ()
    )&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;&amp;nbsp;(i'm using 1 as a value so all connections have the same width)&lt;BR /&gt;&lt;BR /&gt;will show me my multiple steps process for the selected items in the first table:&lt;FONT color="#FF0000"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;just add one more OR ( || ) to add one more step&lt;/P&gt;</description>
    <pubDate>Sun, 21 Jun 2020 16:35:47 GMT</pubDate>
    <dc:creator>avatorl</dc:creator>
    <dc:date>2020-06-21T16:35:47Z</dc:date>
    <item>
      <title>Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157105#M17696</link>
      <description>&lt;P&gt;Hi, I'd like to create a "dynamic" table which should be filtered by other tables, but without using relationships (I have too many of them in place already).&lt;/P&gt;&lt;P&gt;The reason for this is that I need this "dynamic table" as input for a Sankey Chart visual.&lt;BR /&gt;&lt;BR /&gt;I've tried with DAX and TREATAS but I realized that the table created is then static, so not reacting to filters applied to the Source table in the report:&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;Dynamic table =
    CALCULATETABLE(
        Destination,
        TREATAS(VALUES(Source[ID], Destination[ID])
        )&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;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 14:08:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157105#M17696</guid>
      <dc:creator>OnlyPhilip</dc:creator>
      <dc:date>2020-06-13T14:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157180#M17702</link>
      <description>&lt;P&gt;Your TREATAS() implementation doesn't look right.&amp;nbsp; Please check the documentation again.&amp;nbsp; As always you can make your source table dynamic, based on current filter context or other criteria.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 16:27:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157180#M17702</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-13T16:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157467#M17712</link>
      <description>&lt;P&gt;Calculated tables like that one are static, but you likely want to use TREATAS in a measure instead, as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New Measure = CALCULATE([YourMeasure], TREATAS(VALUES(Source[ID]), Destination[ID]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use that pattern for each of the measures that work on the Destination table that you need.&amp;nbsp; You would need to use slicers, etc. from your Source table if you need to select certain values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 01:22:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157467#M17712</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-06-14T01:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157598#M17725</link>
      <description>&lt;P&gt;Can you explain why you need a dynamic table for your sankey to work? A sankey requires a source and destination which should be in your data, this dataset can be filtered using your slicers. Your question implies you need to dynamically define the source and destination?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 09:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157598#M17725</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-14T09:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157641#M17727</link>
      <description>&lt;P&gt;If I understadn what you need then you can use the following:&lt;BR /&gt;&lt;BR /&gt;Let's say you have 3 tables:&lt;BR /&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;: Source Name (text), Destinaton Name (text), Value (number) columns&lt;BR /&gt;&lt;STRONG&gt;Source&lt;/STRONG&gt;: Name column (ditinct list of source names)&lt;BR /&gt;&lt;STRONG&gt;Destination&lt;/STRONG&gt;: Name column (distinct list of destination names)&lt;BR /&gt;&lt;BR /&gt;No relationships between tables.&lt;BR /&gt;&lt;BR /&gt;Create 2 slicers - one based on Source[Name] table, second based on Destination[Name].&lt;BR /&gt;&lt;BR /&gt;Put Data[Source Name] and Data[Destination] into corresponding fields of the visual.&lt;BR /&gt;And use this measure for Weight field of the slicer:&lt;BR /&gt;&lt;BR /&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sankey Chart Value = IF ( 
    AND ( 
        SELECTEDVALUE( Data[Destination Name] ) IN VALUES ( Source[Name] ),
        SELECTEDVALUE( Data[Source Name] ) IN VALUES (Destination[Name] )
    ),
    SELECTEDVALUE( Data[Value] ),
    BLANK()
)&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The chart will show only connections between sources/destinations selected in the slicers, otherwise the measure returns BLANK() and the pair dissapears from the chart.&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is just a base. You can modify the measure as you wnat (e.g. look up a value in 4th table) or check other slicers.&lt;BR /&gt;&lt;BR /&gt;Let me know if it works for you,&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 11:13:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1157641#M17727</guid>
      <dc:creator>avatorl</dc:creator>
      <dc:date>2020-06-14T11:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1160419#M17782</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198497" data-lia-user-login="avatorl" class="lia-mention lia-mention-user"&gt;avatorl&lt;/a&gt;&amp;nbsp;thanks for your answer, I was able to replicate your suggestion. Nevertheless I still can't filter the Source and Destination tables. I'll try to explain the issue more in detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm replicating a production process made of 4 steps by means of tables connected the one to the others to simulate how production lots produced in step "n" flow to lot "n+1". Simplifying, I have tables with this kind of relationships (actually intermediate tables are needed as well):&lt;/P&gt;&lt;P&gt;ProdStep1 --&amp;gt; ProdStep2 --&amp;gt; ProdStep3 --&amp;gt; ProdStep4&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I click on a visual with lot names from ProdStep1, I'll see the filter propagating to the other tables to show which are the downstream lots that made use of the selected lot.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;"Sankey" Source and Destination tables contain all the (distinct) lots produced in the 4 production steps. Unfortunately I can't simply create relationships between the lots in the ProdStep tables and the Source and Destination tables, or I'll have an issue due to relationships conflict.&lt;/P&gt;&lt;P&gt;So I need to manually select, as you wrote, the lots from Source and Destination tables, but this is not helping.&lt;/P&gt;&lt;P&gt;Is there a way to propagate the filter from ProdStep1, 2, 3 &amp;amp; 4 to Source and Destination without making use of relationships?&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 14:53:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1160419#M17782</guid>
      <dc:creator>OnlyPhilip</dc:creator>
      <dc:date>2020-06-15T14:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1172435#M18112</link>
      <description>&lt;P&gt;I'm not sure I understand what you need well but It looks like you don't want to filter your source and destination tables manually. But you want to get them filtered based on a filter applied to ProdStep1 table.&lt;BR /&gt;&lt;BR /&gt;Then you probably don't need Source and Destination tables at all. Use your ProdStep* tables.&lt;BR /&gt;&lt;BR /&gt;Let's say you have a filter applied to&amp;nbsp;ProdStep1 table. And it has relationships with&amp;nbsp;ProdStep2 and&amp;nbsp;ProdStep3 and&amp;nbsp;ProdStep4. So these 3 tables are fltered by the filter applied to&amp;nbsp;ProdStep1.&amp;nbsp; I will use only 3 tables in my example:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;My 'All Products' table has 2 columns and (distinct number of products) * (distinct number of products) rows (10K rows for 100 products). For each ID in Column 1 there is a list of all IDs in Column 2.&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Now this measure:&lt;BR /&gt;&lt;BR /&gt;&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;Measure := 
VAR _source =
    SELECTEDVALUE ( 'All Products'[Column1] )
VAR _destination =
    SELECTEDVALUE ( 'All Products'[Column2] )
RETURN
    IF (
        AND (
            _source IN VALUES ( Table01[Column1] ),
            _destination
                IN SELECTCOLUMNS (
                    FILTER ( Table02, Table02[Column2] = _source ),
                    "id", Table02[Column1]
                )
        )
            || AND (
                _source IN VALUES ( Table02[Column1] ),
                _destination
                    IN SELECTCOLUMNS (
                        FILTER ( Table03, Table03[Column2] = _source ),
                        "id", Table03[Column1]
                    )
            ),
        1,
        BLANK ()
    )&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;&amp;nbsp;(i'm using 1 as a value so all connections have the same width)&lt;BR /&gt;&lt;BR /&gt;will show me my multiple steps process for the selected items in the first table:&lt;FONT color="#FF0000"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;just add one more OR ( || ) to add one more step&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 16:35:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1172435#M18112</guid>
      <dc:creator>avatorl</dc:creator>
      <dc:date>2020-06-21T16:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter tables without relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1172457#M18113</link>
      <description>&lt;P&gt;&lt;EM&gt;I've upadted the above measure (and screenshot). Now it should work well .&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 16:17:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-tables-without-relationships/m-p/1172457#M18113</guid>
      <dc:creator>avatorl</dc:creator>
      <dc:date>2020-06-21T16:17:22Z</dc:date>
    </item>
  </channel>
</rss>

