<?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: In Search of an Efficient Approach for Grouping and Analyzing Measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279575#M169822</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="22609" data-lia-user-login="Marc76" class="lia-mention lia-mention-user"&gt;Marc76&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This could be done either using Calculation Group + Disconnected table or&amp;nbsp;Disconnected table only.&lt;BR /&gt;For later, first, you need to define the levels GROUP, MEASURE, and BREAKUP(&lt;SPAN&gt;Budget, Real...) then build your measures based on the filter context of these fileds in the Disconnected table.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 09:23:12 GMT</pubDate>
    <dc:creator>Fowmy</dc:creator>
    <dc:date>2024-11-12T09:23:12Z</dc:date>
    <item>
      <title>In Search of an Efficient Approach for Grouping and Analyzing Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279539#M169819</link>
      <description>&lt;P&gt;Hey everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will now present the scenario I have, and I need your help to see how you would approach it. I have “solved” it in an incorrect way because my solution consumes too many resources and is inefficient&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have 5 measures, measure1, measure2 … measure5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These measures visually need to be grouped (as a visual separation without totaling) into two groups:&lt;/P&gt;&lt;P&gt;Group 1: measure1 …3&lt;/P&gt;&lt;P&gt;Group 2: measure4, measure5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each measure, I have:&lt;/P&gt;&lt;P&gt;Budget, Real, Budget LY, Real LY, Budget YTD, Real YTD, Budget LYTD, Real LYTD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 companies:&lt;/P&gt;&lt;P&gt;Company 1, Company 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measures were developed before the existence of calculation groups (but I don’t know if the solution involves calculation groups).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I will show you the grid structure I am looking to visualize.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help on how you would approach the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 08:59:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279539#M169819</guid>
      <dc:creator>Marc76</dc:creator>
      <dc:date>2024-11-12T08:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: In Search of an Efficient Approach for Grouping and Analyzing Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279575#M169822</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="22609" data-lia-user-login="Marc76" class="lia-mention lia-mention-user"&gt;Marc76&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This could be done either using Calculation Group + Disconnected table or&amp;nbsp;Disconnected table only.&lt;BR /&gt;For later, first, you need to define the levels GROUP, MEASURE, and BREAKUP(&lt;SPAN&gt;Budget, Real...) then build your measures based on the filter context of these fileds in the Disconnected table.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 09:23:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279575#M169822</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2024-11-12T09:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: In Search of an Efficient Approach for Grouping and Analyzing Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279814#M169841</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="22609" data-lia-user-login="Marc76" class="lia-mention lia-mention-user"&gt;Marc76&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for sharing the structure! Based on your requirements, the ideal approach to improve efficiency and avoid redundancy is to leverage &lt;STRONG&gt;Calculation Groups&lt;/STRONG&gt; in Power BI. Calculation Groups allow you to create a set of dynamic measures (like Budget, Real, LY, YTD, etc.) that can be applied across different base measures (Measure1, Measure2, etc.), making the model more efficient.&lt;/P&gt;&lt;P&gt;Here's a suggested approach:&lt;/P&gt;&lt;H3&gt;1. Create Calculation Groups for the Metrics&lt;/H3&gt;&lt;P&gt;In Power BI, you can create Calculation Groups using &lt;STRONG&gt;Tabular Editor&lt;/STRONG&gt; (either the free external Tabular Editor or the built-in Tabular Editor in Power BI Premium).&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Open Tabular Editor&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In Power BI, go to &lt;STRONG&gt;External Tools&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Tabular Editor&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Calculation Group&lt;/STRONG&gt; for metrics like Budget, Real, LY, and YTD:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In Tabular Editor, right-click on &lt;STRONG&gt;Tables&lt;/STRONG&gt; and select &lt;STRONG&gt;Create New&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Calculation Group&lt;/STRONG&gt;. Name it &lt;STRONG&gt;Metrics&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Under this Calculation Group, create &lt;STRONG&gt;Calculation Items&lt;/STRONG&gt; for each metric (e.g., Budget, Real, Budget LY, Real LY, Budget YTD, Real YTD, Budget LYTD, Real LYTD).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Calculation Item: Budget&lt;/STRONG&gt;&lt;BR /&gt;SELECTEDMEASURE()&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Calculation Item: Real&lt;/STRONG&gt;&lt;BR /&gt;SELECTEDMEASURE()&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Calculation Item: Budget LY&lt;/STRONG&gt;&lt;BR /&gt;(Add the DAX logic to calculate last year's budget for each measure.)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Calculation Item: Real YTD&lt;/STRONG&gt;&lt;BR /&gt;(Add the DAX logic to calculate the year-to-date Real value for each measure.)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Repeat for all required metrics.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;2. Apply Calculation Group to Measures&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Since &lt;STRONG&gt;Calculation Groups&lt;/STRONG&gt; work with any measure, you only need to create your five base measures (Measure1, Measure2, Measure3, etc.) once, without duplicating them for each metric.&lt;/LI&gt;&lt;LI&gt;You can add these base measures in your table visual, and use the Calculation Group to dynamically switch between the metrics.&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;3. Set Up the Table Visual in Power BI&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;In Power BI, use a &lt;STRONG&gt;Matrix visual&lt;/STRONG&gt; to display the data.&lt;/LI&gt;&lt;LI&gt;Put &lt;STRONG&gt;Company&lt;/STRONG&gt; in the &lt;STRONG&gt;Columns&lt;/STRONG&gt; field.&lt;/LI&gt;&lt;LI&gt;Put &lt;STRONG&gt;Month-Year&lt;/STRONG&gt; (M-Y) in the &lt;STRONG&gt;Rows&lt;/STRONG&gt; field to handle the date filtering.&lt;/LI&gt;&lt;LI&gt;Put &lt;STRONG&gt;Calculation Items&lt;/STRONG&gt; (from the &lt;STRONG&gt;Metrics Calculation Group&lt;/STRONG&gt;) in the &lt;STRONG&gt;Columns&lt;/STRONG&gt; to dynamically display Budget, Real, LY, YTD, etc.&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;4. Grouping the Measures (Visual Grouping)&lt;/H3&gt;&lt;P&gt;To achieve visual grouping (without totaling), you can add a &lt;STRONG&gt;Dummy Group&lt;/STRONG&gt; column to your measures in the model and use it to create groups like &lt;STRONG&gt;Group 1&lt;/STRONG&gt; and &lt;STRONG&gt;Group 2&lt;/STRONG&gt;. This can be done by creating a new column in your measure table.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure Group = 
SWITCH(
    TRUE(),
    [Measure] IN {"Measure1", "Measure2", "Measure3"}, "Group 1",
    [Measure] IN {"Measure4", "Measure5"}, "Group 2",
    BLANK()
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, add this &lt;STRONG&gt;Measure Group&lt;/STRONG&gt; to your &lt;STRONG&gt;Rows&lt;/STRONG&gt; in the Matrix visual for grouping.&lt;/P&gt;&lt;H3&gt;Final Result&lt;/H3&gt;&lt;P&gt;This approach will:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Enable you to dynamically switch between Budget, Real, LY, YTD, etc., using the &lt;STRONG&gt;Calculation Group&lt;/STRONG&gt; without duplicating each measure.&lt;/LI&gt;&lt;LI&gt;Reduce resource consumption by only calculating the necessary values on the fly.&lt;/LI&gt;&lt;LI&gt;Allow visual grouping of measures into "Group 1" and "Group 2" without needing to sum the groups.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This method should be significantly more efficient than creating individual measures for each metric and year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you need further clarification!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 12:29:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/In-Search-of-an-Efficient-Approach-for-Grouping-and-Analyzing/m-p/4279814#M169841</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2024-11-12T12:29:37Z</dc:date>
    </item>
  </channel>
</rss>

