<?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 Complicated Measure filtering multiple columns from different tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complicated-Measure-filtering-multiple-columns-from-different/m-p/3306563#M123500</link>
    <description>&lt;P&gt;Hi All, I'm in need of some severe help. I've been stuck on this issue for a few weeks now &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a bunch of tables with financial data but here are the main ones:&lt;/P&gt;&lt;P&gt;Table 1 - List of expenses by purchase order number and what FY it expires.&lt;/P&gt;&lt;P&gt;Table 2 - Total cost for all purchase order numbers, FY it was purchased in, and a flag if it's a blanket order or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 2 tables are relationshiped on the purchase order number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scope:&lt;/P&gt;&lt;P&gt;1. Have the total purchased for the FY chosen from the slicer from Table 2.&lt;/P&gt;&lt;P&gt;2. Have a total of purchase orders from Table 1 that are expiring next fiscal year which will be the FY after the FY chosen in the slicer and is NOT a blanket order (flag and totals live in table 2)&lt;/P&gt;&lt;P&gt;3. Have the total of #1 and #2 combined for final total needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to do #1 in the scope. I have a card visual that sums the total from Table 2. The slicer takes care of the filter.&lt;/P&gt;&lt;P&gt;I also was able to create a card for #2 but not without some heavy filtering on the card itself. My issue here is because I'm filtering the visual I do not know how to take the outcome of the filters so I can make a 3rd card that totals card 1 and 2 together. I cant add the same filtering on the 3rd card because some of those filters will remove totals from scope #1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help! LOL&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2023 15:37:21 GMT</pubDate>
    <dc:creator>Nicci</dc:creator>
    <dc:date>2023-06-28T15:37:21Z</dc:date>
    <item>
      <title>Complicated Measure filtering multiple columns from different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complicated-Measure-filtering-multiple-columns-from-different/m-p/3306563#M123500</link>
      <description>&lt;P&gt;Hi All, I'm in need of some severe help. I've been stuck on this issue for a few weeks now &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a bunch of tables with financial data but here are the main ones:&lt;/P&gt;&lt;P&gt;Table 1 - List of expenses by purchase order number and what FY it expires.&lt;/P&gt;&lt;P&gt;Table 2 - Total cost for all purchase order numbers, FY it was purchased in, and a flag if it's a blanket order or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 2 tables are relationshiped on the purchase order number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scope:&lt;/P&gt;&lt;P&gt;1. Have the total purchased for the FY chosen from the slicer from Table 2.&lt;/P&gt;&lt;P&gt;2. Have a total of purchase orders from Table 1 that are expiring next fiscal year which will be the FY after the FY chosen in the slicer and is NOT a blanket order (flag and totals live in table 2)&lt;/P&gt;&lt;P&gt;3. Have the total of #1 and #2 combined for final total needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to do #1 in the scope. I have a card visual that sums the total from Table 2. The slicer takes care of the filter.&lt;/P&gt;&lt;P&gt;I also was able to create a card for #2 but not without some heavy filtering on the card itself. My issue here is because I'm filtering the visual I do not know how to take the outcome of the filters so I can make a 3rd card that totals card 1 and 2 together. I cant add the same filtering on the 3rd card because some of those filters will remove totals from scope #1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help! LOL&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 15:37:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complicated-Measure-filtering-multiple-columns-from-different/m-p/3306563#M123500</guid>
      <dc:creator>Nicci</dc:creator>
      <dc:date>2023-06-28T15:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Measure filtering multiple columns from different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complicated-Measure-filtering-multiple-columns-from-different/m-p/3412722#M129039</link>
      <description>&lt;P&gt;For the first scope, you've already managed to get the total purchased for the FY chosen from the slicer from Table 2. That's great! Let's call this measure TotalPurchasedFY.&lt;/P&gt;
&lt;P&gt;For the second scope, you want to get the total of purchase orders from Table 1 that are expiring next fiscal year, which is the FY after the one chosen in the slicer, and is NOT a blanket order. Let's create a DAX measure for this:&lt;/P&gt;
&lt;P&gt;TotalExpiringNextFY = &lt;BR /&gt;VAR CurrentFY = SELECTEDVALUE('Table 2'[FY])&lt;BR /&gt;VAR NextFY = CurrentFY + 1&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;'Table 1',&lt;BR /&gt;'Table 1'[ExpiryFY] = NextFY&lt;BR /&gt;),&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Table 2'[TotalCost]),&lt;BR /&gt;'Table 2'[BlanketOrderFlag] = 0&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;In this measure, we first determine the current FY from the slicer and then calculate the next FY. We then filter Table 1 for rows where the expiry FY matches the next FY. For each of these rows, we sum the total cost from Table 2 where it's not a blanket order.&lt;/P&gt;
&lt;P&gt;Now, for the third scope, you want to combine the totals of the first two scopes. This is straightforward:&lt;/P&gt;
&lt;P&gt;FinalTotal = TotalPurchasedFY + TotalExpiringNextFY&lt;BR /&gt;You can now use the FinalTotal measure in a card visual to get the combined total of the first two scopes.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 17:36:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complicated-Measure-filtering-multiple-columns-from-different/m-p/3412722#M129039</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2023-09-03T17:36:52Z</dc:date>
    </item>
  </channel>
</rss>

