<?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: GROUPBY Returning an Error, Please Help. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097076#M16051</link>
    <description>&lt;LI-CODE lang="csharp"&gt;Table = 
ADDCOLUMNS( 
	VALUES( T[Date] ),
	"TotalTimeForDay",
		CALCULATE(
			SUM( T[Decimal Time] )
		)
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2020 01:41:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-05-20T01:41:11Z</dc:date>
    <item>
      <title>GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097070#M16050</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having difficulty creating a measure using DAX. I want to group records by DATE and get TOTAL DECIMAL TIME of each group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I'm using the GROUPBY function, but I'm receiving an error indicating that I've given the function 2 columns. I believe I have only given one column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please assist?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=GROUPBY(Table4&lt;BR /&gt;, Table4[Date]&lt;BR /&gt;,"TotalTimeForDay"&lt;BR /&gt;, SUMX( CURRENTGROUP(), Table4[Decimal Time])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My error:&lt;/P&gt;&lt;P&gt;Calculation error in measure 'Table4'[Test1]: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 01:33:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097070#M16050</guid>
      <dc:creator>jaime_blackwell</dc:creator>
      <dc:date>2020-05-20T01:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097076#M16051</link>
      <description>&lt;LI-CODE lang="csharp"&gt;Table = 
ADDCOLUMNS( 
	VALUES( T[Date] ),
	"TotalTimeForDay",
		CALCULATE(
			SUM( T[Decimal Time] )
		)
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 01:41:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097076#M16051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T01:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097080#M16052</link>
      <description>&lt;P&gt;Hi D,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for your response. I have keyed the below into my measure however I still receive the same error. Do you know why this is occuring?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;=ADDCOLUMNS(VALUES(Table4[Date]), "TotalTimeForDay", CALCULATE(SUM(Table4[Decimal Time])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;Calculation error in measure 'Table4'[Test1]: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 01:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097080#M16052</guid>
      <dc:creator>jaime_blackwell</dc:creator>
      <dc:date>2020-05-20T01:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097104#M16054</link>
      <description>It's not a measure. It's a calculated table.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Wed, 20 May 2020 02:08:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097104#M16054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T02:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097126#M16055</link>
      <description>&lt;P&gt;Hi D,&lt;/P&gt;&lt;P&gt;The reason why I'm looking to achieve this within a measure is because the desired output is a measure and not a calculated table. The end result in my case is Percentage billable per user per day. The questions above is only part of the calculation (eg. I also need to minus 30 minutes from each user's day if they worked more than 5 hours that day).&lt;/P&gt;&lt;P&gt;Hope this makes sense. So with that said, do you know any way to achieve the desired result in the context of a measure rather than calculated table?&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 02:19:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097126#M16055</guid>
      <dc:creator>jaime_blackwell</dc:creator>
      <dc:date>2020-05-20T02:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097142#M16057</link>
      <description>I believe your requirements for a measure are not correct. You say:&lt;BR /&gt;&lt;BR /&gt;"I want to group records by DATE and get TOTAL DECIMAL TIME of each group."&lt;BR /&gt;&lt;BR /&gt;Grouping by date does not contribute anything if you want a measure. You can write:&lt;BR /&gt;&lt;BR /&gt;sum( T[Decimal Time] )&lt;BR /&gt;&lt;BR /&gt;and that's it. The rest is a matter of slicing and dicing.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Wed, 20 May 2020 02:34:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097142#M16057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T02:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097244#M16063</link>
      <description>&lt;P&gt;Hi D,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that case, how would you suggest I tackle the below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some time record data which includes Date, User, Time(duration) and whether the line is billable time or not. The dataset has many different users and contains a whole week of data. I would like to calculate the percentage of billable time for each user. However, if the person worked more than 5 hours on a given date, the calculation needs to deduct a 30 minute lunch break from their 'non-billable' time. I have almost succeeded with a measure, but the date is not taken into account. So the time taken out to account for lunch breaks is innacurate. Currently, the calculation sees that User A has worked 38 hours total, so it minuses 30 minutes. I need it to check how long the person worked on every date, and minus 30 minutes for every time the person worked more than 5 hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason why I want this to be a dax measure is because the calculation will also be used to populate a Pivot Table in Excel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 03:42:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097244#M16063</guid>
      <dc:creator>jaime_blackwell</dc:creator>
      <dc:date>2020-05-20T03:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097783#M16075</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Total Time] = SUM( T[Decimal Time] )

[Billable Time] =
var __breakTime = 1 * time(0, 30, 0)
var __result =
	SUMX(
		SUMMARIZE(
			T,
			T[UserID],
			T[Date]
		),
		var __time = [Total Time]
		var __deduction = ( __time &amp;gt; 5 ) * __breakTime
		return
			__time - __deduction
	)
return
	__result
	
[Billable Time %] =
	DIVIDE(
		[Billable Time],
		[Total Time]
	)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 09:30:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1097783#M16075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T09:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: GROUPBY Returning an Error, Please Help.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1099968#M16132</link>
      <description>&lt;P&gt;Thank you so much D!&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 05:25:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/GROUPBY-Returning-an-Error-Please-Help/m-p/1099968#M16132</guid>
      <dc:creator>jaime_blackwell</dc:creator>
      <dc:date>2020-05-21T05:25:33Z</dc:date>
    </item>
  </channel>
</rss>

