<?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: Calculated Column: Return a value only once on the same day for the same resource. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3360861#M126341</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="596788" data-lia-user-login="Buckeyes2016" class="lia-mention lia-mention-user"&gt;Buckeyes2016&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can follow the steps below to get it, please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs0tyMmvTE1VMFTSUTLUN9Q3MjAyBjItlGJ1qCprhFfWmCxZI7wmUy5rglfWlGjZWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Resource = _t, Date = _t, #"Available Hours" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Resource", type text}, {"Date", type date}, {"Available Hours", Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Resource", Order.Ascending}, {"Date", Order.Ascending}}),
    #"Grouped Rows" = Table.Group(#"Sorted Rows", {"Resource","Date","Available Hours"}, {{"Index", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
    #"Expanded Index" = Table.ExpandTableColumn(#"Grouped Rows", "Index", {"Index"}, {"Index"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Index", "Return", each if [Index]=1 then [Available Hours] else null),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
    #"Removed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2023 03:03:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-02T03:03:10Z</dc:date>
    <item>
      <title>Calculated Column: Return a value only once on the same day for the same resource.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3358775#M126251</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working to create a column in my PowerBI TimeEntry data table that returns the value 8 for "available hours" only once for a given employee on a given date. My data currently looks like the first three columns on the table below and I would like to create a 4th column that looks like the table below. I have tried several approaches and have not found something that works. Thank you so much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Resource&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Available Hours&lt;/TD&gt;&lt;TD&gt;Return&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Employee 1&lt;/TD&gt;&lt;TD&gt;1/1/2023&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Employee 1&lt;/TD&gt;&lt;TD&gt;1/1/2023&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Employee 1&lt;/TD&gt;&lt;TD&gt;1/1/2023&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;T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Employee 2&lt;/TD&gt;&lt;TD&gt;5/1/2022&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 00:30:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3358775#M126251</guid>
      <dc:creator>Buckeyes2016</dc:creator>
      <dc:date>2023-08-01T00:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column: Return a value only once on the same day for the same resource.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3358780#M126252</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is a better view of what I am trying to return. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 00:32:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3358780#M126252</guid>
      <dc:creator>Buckeyes2016</dc:creator>
      <dc:date>2023-08-01T00:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column: Return a value only once on the same day for the same resource.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3360861#M126341</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="596788" data-lia-user-login="Buckeyes2016" class="lia-mention lia-mention-user"&gt;Buckeyes2016&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can follow the steps below to get it, please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs0tyMmvTE1VMFTSUTLUN9Q3MjAyBjItlGJ1qCprhFfWmCxZI7wmUy5rglfWlGjZWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Resource = _t, Date = _t, #"Available Hours" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Resource", type text}, {"Date", type date}, {"Available Hours", Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Resource", Order.Ascending}, {"Date", Order.Ascending}}),
    #"Grouped Rows" = Table.Group(#"Sorted Rows", {"Resource","Date","Available Hours"}, {{"Index", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
    #"Expanded Index" = Table.ExpandTableColumn(#"Grouped Rows", "Index", {"Index"}, {"Index"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Index", "Return", each if [Index]=1 then [Available Hours] else null),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
    #"Removed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 03:03:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-Return-a-value-only-once-on-the-same-day-for/m-p/3360861#M126341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-02T03:03:10Z</dc:date>
    </item>
  </channel>
</rss>

