<?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: Dealing with granularity - best practice in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934761#M153065</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="654567" data-lia-user-login="clay_75" class="lia-mention lia-mention-user"&gt;clay_75&lt;/a&gt;&amp;nbsp;- If you would just like to find the&amp;nbsp;Cluster Duration SUMMARIZE will work, you just need to create it as a virtual table, inside a variable (VAR) in a measure, then iterate through that varible to return it for each Task Reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've amended your DAX slightly below, but you'll see from the screenshot this is tested and works:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cluster_Duration = 
VAR _table =
    SUMMARIZE (
        VALUES ( 'Table (7)'[Task Reference] ),
        "Duration Mins", MIN ( 'Table (7)'[Cluster Duration] )
    )
RETURN
    SUMX ( _table, [Duration Mins] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please accept it as the solution.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2024 08:53:00 GMT</pubDate>
    <dc:creator>mark_endicott</dc:creator>
    <dc:date>2024-05-21T08:53:00Z</dc:date>
    <item>
      <title>Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934391#M153058</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New to DAX and Power BI - wanting to know how to handle metrics of different granularity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using&amp;nbsp; an SQL view that returns order picking info - it includes multiple levels of granularity i.e.&lt;/P&gt;&lt;P&gt;- A cluster id (orders that were picked toghether&lt;/P&gt;&lt;P&gt;- order number&lt;/P&gt;&lt;P&gt;- product / location etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have metrics such as "time to pick" which is at the product / locatino level and "cluster duration" which is at the cluster id level. Cluster duration is not just the sum of "time to pick" - it includes other time not necessarily spent picking.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just created a report at the Cluster id level and realised that it's summing the repeated "cluster duration" - what's the best way to handle this? Do i create a new table with SUMMARIZE or something.?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. this is returning the result i want in DAX Studio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
	SUMMARIZECOLUMNS(
		ClusterAudit[Task Reference],
		"Cluster Duration (mins)", MIN(ClusterAudit[Cluster Duration Mins]),
		"Pick Time (mins)", MIN(ClusterAudit[Pick Time Mins])
		)
ORDER BY
ClusterAudit[Task Reference]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clay&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 06:49:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934391#M153058</guid>
      <dc:creator>clay_75</dc:creator>
      <dc:date>2024-05-21T06:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934489#M153059</link>
      <description>&lt;P&gt;Note, my inclusion of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"Pick Time (mins)", MIN(ClusterAudit[Pick Time Mins])&lt;/PRE&gt;&lt;P&gt;might be confusing....this is just another metric at the ClusterAudit[Task Reference] level - it's not the same as the sum of "time to pick".&amp;nbsp; Time to pick measures the time between each pick and "Pick Time Mins" is the total duration minus any time where the task was suspended (e.g. lunch) &amp;gt; cluster duration includes start time to end time regardless of suspensions&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 07:13:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934489#M153059</guid>
      <dc:creator>clay_75</dc:creator>
      <dc:date>2024-05-21T07:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934761#M153065</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="654567" data-lia-user-login="clay_75" class="lia-mention lia-mention-user"&gt;clay_75&lt;/a&gt;&amp;nbsp;- If you would just like to find the&amp;nbsp;Cluster Duration SUMMARIZE will work, you just need to create it as a virtual table, inside a variable (VAR) in a measure, then iterate through that varible to return it for each Task Reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've amended your DAX slightly below, but you'll see from the screenshot this is tested and works:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cluster_Duration = 
VAR _table =
    SUMMARIZE (
        VALUES ( 'Table (7)'[Task Reference] ),
        "Duration Mins", MIN ( 'Table (7)'[Cluster Duration] )
    )
RETURN
    SUMX ( _table, [Duration Mins] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please accept it as the solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:53:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3934761#M153065</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-05-21T08:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3941286#M153233</link>
      <description>&lt;P&gt;Thanks Mark - that appears to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Picking Mins = 
    SUMX(
        SUMMARIZE(
            ClusterAudit,
            ClusterAudit[Task Reference],
            "Picking Mins", MIN(ClusterAudit[Cluster Duration Mins])
        ),
        [Picking Mins]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This also appears to work - performance analyzer showing me the same numbers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a difference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 03:03:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3941286#M153233</guid>
      <dc:creator>clay_75</dc:creator>
      <dc:date>2024-05-23T03:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3941290#M153234</link>
      <description>&lt;P&gt;I've also added this to my source query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DENSE_RANK() OVER (ORDER BY CI.[Task Reference]) AS TaskId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that i can summarize by an integer rather than a string - i have about 6 task level measures to aggregate. I'm only guessing an integer will be better....any comment on this much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clay&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 03:05:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3941290#M153234</guid>
      <dc:creator>clay_75</dc:creator>
      <dc:date>2024-05-23T03:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3942432#M153266</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="654567" data-lia-user-login="clay_75" class="lia-mention lia-mention-user"&gt;clay_75&lt;/a&gt;&amp;nbsp;- No, this will result in exactly the same query plan. I just like to separate things out with variables for readability.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 08:21:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3942432#M153266</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-05-23T08:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with granularity - best practice</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3942445#M153267</link>
      <description>&lt;P&gt;Intergers make better surrogate keys than strings, yes. They are more optimal for data storage due to the types of compression the Vertipaq engine uses.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 08:24:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dealing-with-granularity-best-practice/m-p/3942445#M153267</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-05-23T08:24:37Z</dc:date>
    </item>
  </channel>
</rss>

