<?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: Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4841396#M184837</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17552" data-lia-user-login="asjones" class="lia-mention lia-mention-user"&gt;asjones&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Oct 2025 10:32:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-10-03T10:32:18Z</dc:date>
    <item>
      <title>Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4835510#M184687</link>
      <description>&lt;P&gt;I have don’t this in the past with data from our ERP with Power Query when it was one big flat table. However, I am hitting a big wall trying to do this in Power BI with many related tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create some groupings in Power BI for tables and charts. I have looked at several examples, but most seem to have a less complicated data model. I had considered Power Query, but I need to kook at multiple related tables and did not want a massive flat table again. The DAX I saw was confusing and there seemed to be some cautions. I have 5-7 different groupings (A, B, C, D, E…). I have actual expense and budget tables. In order for an amount to be summed into one of the categories it must meet several criteria that are in different related tables.&lt;/P&gt;&lt;P&gt;It must&lt;/P&gt;&lt;P&gt;Be in a certain Account Rage&lt;/P&gt;&lt;P&gt;Be in certain Cost Centers,&lt;/P&gt;&lt;P&gt;Be a specific Project Type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output might look like this&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Category&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2025 Actuals YTD&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2025 Projection&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2026 Budget&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2027 Budget&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2028 Budget&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;14143&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;14134&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;326&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3453&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;433&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;B&lt;/STR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t;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3567&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3572&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create a single measure to do one category but, I am really after either a “real” table via Power Query or a DAX query.&amp;nbsp; Below is an example a measure if I were creating category A as a single measure for Actuals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help ang guidance from multiple angles would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Alan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For example, for Category A measure might look like this, unfortunately I need that as a “row” not a new column.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;A =&lt;/P&gt;&lt;P&gt;VAR _Amount =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM ( 'Actuals'[Amount4] ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEEPFILTERS (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUE ( 'Account Relations'[Head Account] ) &amp;gt;= 50000&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; VALUE ( 'Account Relations'[Head Account] ) &amp;lt;= 69999&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; VALUE ( 'Account Relations'[Head Account] ) &amp;lt;&amp;gt; 56950&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEEPFILTERS (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUE ( 'Account Relations'[Account] ) &amp;lt;&amp;gt; 96910&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; VALUE ( 'Account Relations'[Account] ) &amp;lt;&amp;gt; 96950&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEEPFILTERS (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUE ( 'Main Project Master File - PMF'[PMF Project Type] ) &amp;gt;= 30&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; VALUE ( 'Main Project Master File - PMF'[PMF Project Type] ) &amp;lt;= 69&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEEPFILTERS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUE('Department Relations'[Cost Center]) &amp;gt;=10&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; VALUE( 'Department Relations'[Cost Center]) &amp;lt;= 20&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; _Amount&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;</description>
      <pubDate>Thu, 25 Sep 2025 14:10:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4835510#M184687</guid>
      <dc:creator>asjones</dc:creator>
      <dc:date>2025-09-25T14:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4835642#M184689</link>
      <description>&lt;P&gt;Without seeing your exact model it is hard to give an exact answer, however here is one approach you may be able to use.&lt;BR /&gt;Using the example model below...&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Sample data in the fact table...&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can create a table with the following code...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = 
var _catA = 
FILTER(
    fact_table,
    RELATED(dim_parent[Parent Account]) IN {"ABC", "DEF"} &amp;amp;&amp;amp; RELATED(dim_child[Child Account]) = 123 &amp;amp;&amp;amp; RELATED(dim_project[Project Type]) = 30
)
var _catB = 
FILTER(
    fact_table,
    RELATED(dim_parent[Parent Account]) IN {"DEF"} &amp;amp;&amp;amp; RELATED(dim_child[Child Account]) = 456 &amp;amp;&amp;amp; RELATED(dim_project[Project Type]) = 30
)
RETURN
UNION(
    SELECTCOLUMNS({"A"}, "Category", "A", "2025 Actuals", SUMX(_catA, [Actual]), "2026 Budget", SUMX(_catA, [2026 Budget]), "2027 Budget", SUMX(_catA, [2027 Budget])), 
    SELECTCOLUMNS({"B"}, "Category", "B", "2025 Actuals", SUMX(_catB, [Actual]), "2026 Budget", SUMX(_catB, [2026 Budget]), "2027 Budget", SUMX(_catB, [2027 Budget]))
)&lt;/LI-CODE&gt;
&lt;P&gt;And end up with a table that looks like this...&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Hope this points you in the right direction.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 15:51:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4835642#M184689</guid>
      <dc:creator>jgeddes</dc:creator>
      <dc:date>2025-09-25T15:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4837791#M184753</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17552" data-lia-user-login="asjones" class="lia-mention lia-mention-user"&gt;asjones&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="430441" data-lia-user-login="jgeddes" class="lia-mention lia-mention-user"&gt;jgeddes&lt;/a&gt;&amp;nbsp;Thanks for your inputs&lt;/P&gt;
&lt;P&gt;I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 11:04:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4837791#M184753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-09-29T11:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4837936#M184760</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="430441" data-lia-user-login="jgeddes" class="lia-mention lia-mention-user"&gt;jgeddes&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the delay in responding. Had some issues come up. I really like your idea. That looks clean. I did see many ideas sugges a switch statment and calcualted columns. Even the SQL BI people seemed to go down the SWITCH() and calculcated columns path.&lt;BR /&gt;&lt;A href="https://www.daxpatterns.com/abc-classification/" target="_blank"&gt;https://www.daxpatterns.com/abc-classification/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Do you have any thoughts on the pros/cons?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 13:08:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4837936#M184760</guid>
      <dc:creator>asjones</dc:creator>
      <dc:date>2025-09-29T13:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4841396#M184837</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17552" data-lia-user-login="asjones" class="lia-mention lia-mention-user"&gt;asjones&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 10:32:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4841396#M184837</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-10-03T10:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4845419#M184932</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17552" data-lia-user-login="asjones" class="lia-mention lia-mention-user"&gt;asjones&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The SWITCH() and calculated column method works great when all your grouping rules are in one table. It’s simple to build, performs well, and the category you create can be used right away in slicers or visuals. But once your logic starts pulling from several related tables, it gets harder to manage, you end up needing multiple RELATED() calls, and the model can get heavier. In those situations, creating a summarized table with FILTER and UNION is usually a better choice. It handles multi-table logic more cleanly and keeps your model organized, though it’s static and won’t update with slicers until you refresh the data.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;I&gt;&lt;/I&gt;&lt;/LI-WRAPPER&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 10:55:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-Values-by-Multiple-Criteria-in-several-Tables-DAX-or/m-p/4845419#M184932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-10-08T10:55:22Z</dc:date>
    </item>
  </channel>
</rss>

