<?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: Measure that filters across two dimensions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979832#M11944</link>
    <description>&lt;P&gt;This seems to be working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;COUNTROWS(
    FILTER(
            SUMMARIZE(
            'factOrders',
            'factOrders'[OrderID], 
            "IsOverseasOrder",
            MAX
            (
                MAXX('dimAddress1', IF('dimAddress1'[Is Overseas] = "Y", 1, 0)),
                MAXX('dimAddress2', IF('dimAddress2'[Is Overseas] = "Y", 1, 0))
            )
        ),
        [IsOverseasOrder] = 1
    )
)&lt;/LI-CODE&gt;&lt;P&gt;But it seems far too complicated. Is there a simpler way to do this?&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2020 11:47:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-18T11:47:41Z</dc:date>
    <item>
      <title>Measure that filters across two dimensions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979674#M11941</link>
      <description>&lt;P&gt;I have these facts and dimensions:&lt;/P&gt;&lt;P&gt;factOrders&lt;/P&gt;&lt;P&gt;dimAddress1&lt;/P&gt;&lt;P&gt;dimAddress2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the relationships:&lt;/P&gt;&lt;P&gt;dimAddress1 -&amp;gt; factOrders&lt;/P&gt;&lt;P&gt;dimAddress2 -&amp;gt; factOrders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a measure that does this:&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;Number of Orders with Overseas Addresses :=

DISTINCTCOUNT of factOrders.OrderID

WHERE (dimAddress1.IsOverseas = "Y" OR dimAddress2.IsOverseas = "Y")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my attempt at the DAX:&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; CALCULATE(
    DISTINCTCOUNT('factOrders'[OrderID]),
    'dimAddress1'[Is Overseas] = "Y" || 'dimAddress2'[Is Overseas] = "Y"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it gives the error "The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 10:32:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979674#M11941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-18T10:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Measure that filters across two dimensions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979832#M11944</link>
      <description>&lt;P&gt;This seems to be working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;COUNTROWS(
    FILTER(
            SUMMARIZE(
            'factOrders',
            'factOrders'[OrderID], 
            "IsOverseasOrder",
            MAX
            (
                MAXX('dimAddress1', IF('dimAddress1'[Is Overseas] = "Y", 1, 0)),
                MAXX('dimAddress2', IF('dimAddress2'[Is Overseas] = "Y", 1, 0))
            )
        ),
        [IsOverseasOrder] = 1
    )
)&lt;/LI-CODE&gt;&lt;P&gt;But it seems far too complicated. Is there a simpler way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 11:47:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979832#M11944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-18T11:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Measure that filters across two dimensions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979895#M11946</link>
      <description>&lt;P&gt;Perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;COUNTROWS(
    FILTER(
            SUMMARIZE(
            'factOrders',
            'factOrders'[OrderID], 
            "IsOverseasOrder",
                IF(
                  'dimAddress1'[Is Overseas] = "Y" ||
                    'dimAddress2'[Is Overseas] = "Y",
                  1, 0
                )
            )
        ),
        [IsOverseasOrder] = 1
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Mar 2020 12:39:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/979895#M11946</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-18T12:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Measure that filters across two dimensions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/980093#M11948</link>
      <description>&lt;LI-CODE lang="markup"&gt;// This formula uses this math formula for sets:
// |A + B| = |A| + |B| - |A * B|
// Since the formula does not use OR, it
// might be faster... but can't guarantee it.

# Overeas Orders :=
var __ordersWithOverseasAddr1 = 
	calculate(
		distinctcount( factOrders[OrderId] ),
		keepfilters( dimAddress1.IsOverseas = "Y" )
	)
var __ordersWithAverseasAddr2 =
	calculate(
		distinctcount( factOrders[OrderId] ),
		keepfilters( dimAddress2.IsOverseas = "Y" )
	)
var __ordersWithBothAddrOverseas =
	calculate(
		distinctcount( factOrders[OrderId] ),
		keepfilters( dimAddress2.IsOverseas = "Y" ),
		keepfilters( dimAddress1.IsOverseas = "Y" )
	)
return
	__ordersWithOverseasAddr1
	+ __ordersWithOverseasAddr2
	- __ordersWithBothAddrOverseas&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might not be the simplest but it might be fast and it's easily understandable (if you know math, that is).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 14:26:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-filters-across-two-dimensions/m-p/980093#M11948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-18T14:26:18Z</dc:date>
    </item>
  </channel>
</rss>

