<?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: DAX Measure to Summarize Ship-To State when there are 2 Order Fact Tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3927740#M152802</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;.&amp;nbsp; I understand SWITCH function, and it may come into play here later.&amp;nbsp; Thank you for your suggestion.&lt;BR /&gt;&lt;BR /&gt;However, the main issue with my model is that, since the two order tables are not directly related, attempting to show a ship-to-state in the rows section of the matrix works for rows where the values are from that table, but for rows where the values are from the other table, it shows all ship-to-states.&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 14:08:45 GMT</pubDate>
    <dc:creator>Karl-D</dc:creator>
    <dc:date>2024-05-17T14:08:45Z</dc:date>
    <item>
      <title>DAX Measure to Summarize Ship-To State when there are 2 Order Fact Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3925337#M152737</link>
      <description>&lt;P&gt;I have the following tables and relationships:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fact_orders_a = orders from one system&lt;/LI&gt;&lt;LI&gt;fact_orders_b = orders from another system&lt;/LI&gt;&lt;LI&gt;dim_customer = 1:* to each fact on dim_customer_key&lt;/LI&gt;&lt;LI&gt;dim_item = 1:* to each fact on dim_item_key&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have a matrix visual showing:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Customer Name = dim_customer.customer_name&lt;/LI&gt;&lt;LI&gt;Item Name = dim_item.item_name&lt;/LI&gt;&lt;LI&gt;Order Measure = distinctcount(fact_orders_a.order_number) + distinctcount(fact_orders_b.order_number)&lt;/LI&gt;&lt;LI&gt;Qty Measure = sum(fact_orders_a.order_qty) + distinctcount(fact_orders_b.order_qty)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If I try to add the "Ship-To State" field from either fact table to this visual, it shows &lt;EM&gt;all&lt;/EM&gt; "Ship-To-States" since the fact tables aren't directly related.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I use DAX to create a measure that shows the Country and State from the applicable fact_orders table records on the rows?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 01:44:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3925337#M152737</guid>
      <dc:creator>Karl-D</dc:creator>
      <dc:date>2024-05-17T01:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to Summarize Ship-To State when there are 2 Order Fact Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3925494#M152741</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but one of ways to achieve this is to use SWITCH DAX function in the measure with your business rules when to use which fact table.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/switch-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;SWITCH function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 02:49:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3925494#M152741</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-05-17T02:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to Summarize Ship-To State when there are 2 Order Fact Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3927740#M152802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;.&amp;nbsp; I understand SWITCH function, and it may come into play here later.&amp;nbsp; Thank you for your suggestion.&lt;BR /&gt;&lt;BR /&gt;However, the main issue with my model is that, since the two order tables are not directly related, attempting to show a ship-to-state in the rows section of the matrix works for rows where the values are from that table, but for rows where the values are from the other table, it shows all ship-to-states.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 14:08:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3927740#M152802</guid>
      <dc:creator>Karl-D</dc:creator>
      <dc:date>2024-05-17T14:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to Summarize Ship-To State when there are 2 Order Fact Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3927783#M152803</link>
      <description>&lt;P&gt;To illustrate, the point of the matrix on the right is to combine the two on the left.&lt;BR /&gt;You'll see that the totals are correct.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm just trying to figure out how I can avoid the cartesian product where every ship-to-state from each of the two fact tables is shown rather than just those that are involved in the totals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this example, the "total bottles" measure is calculated as follows&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= 
    CALCULATE(
        DISTINCTCOUNT('fact_orders_a'[Order No.])
        ,'fact_orders_a'[Customer Type]="Wholesale"
        ,'fact_orders_a'[Is Refunded Order]=FALSE())
   -
    CALCULATE(
        DISTINCTCOUNT('fact_orders_a'[Order No.])
        ,'fact_orders_a'[Customer Type]="Wholesale"
        ,'fact_orders_a'[Is Refunded Order]=TRUE())
    +
    CALCULATE(
        DISTINCTCOUNT('fact_orders_b'[order_no])
        )&lt;/LI-CODE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 14:21:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-Summarize-Ship-To-State-when-there-are-2-Order/m-p/3927783#M152803</guid>
      <dc:creator>Karl-D</dc:creator>
      <dc:date>2024-05-17T14:21:38Z</dc:date>
    </item>
  </channel>
</rss>

