<?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: Text and hour into a single column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3477739#M132904</link>
    <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Hour =
FORMAT(
    'Table'[Date],"hh")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Text =
[Hour] &amp;amp;":"&amp;amp;"00"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
var _table1=
{"Rollover"}
var _table2=
UNION(_table1,DISTINCT('Table'[Text]))
return
ADDCOLUMNS(
   _table2,"Rcvd QTY",
    IF(
       [Value]="Rollover",SUMX(ALL('Table'),[Value]),
    SUMX(FILTER(ALL('Table'),'Table'[Text]=EARLIER([Value])),[Value])))&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 03:24:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-16T03:24:20Z</dc:date>
    <item>
      <title>Text and hour into a single column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3472749#M132621</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;hello, i am trying to create a table with a column as above where the rollover will be the first row above the hour. i have tried using IF functions but the result is not the same. the image is showing the hour of the date and i am assuming the rollover are those orders before the current date.&lt;/P&gt;&lt;P&gt;i can definitely create different tables to show the difference, but the desired outcome from the end user is as above snippet.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 07:08:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3472749#M132621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-12T07:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Text and hour into a single column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3473357#M132642</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You can use the following DAX formula as an example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RolloverColumn =&lt;BR /&gt;VAR CurrentHour = HOUR(YourTable[YourDateColumn])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN(YourTable[YourDateColumn]),&lt;BR /&gt;FILTER(YourTable, HOUR(YourTable[YourDateColumn]) &amp;lt; CurrentHour)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace "YourTable" with the name of your table and "YourDateColumn" with the name of the column that contains the dates or timestamps. This formula calculates the minimum date/time value that occurs before the current hour in your table.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Add the new calculated column to your table visualization in the report view.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Format the table as needed to achieve the desired appearance. You can modify the column headers, formatting, and other visual aspects to make it look like the snippet you provided.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This approach will create a table in Power BI where the "RolloverColumn" contains the first row above the hour, just as you described in your snippet. Adjust the column names and formatting as necessary to match your specific requirements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 11:32:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3473357#M132642</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-10-12T11:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Text and hour into a single column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3477739#M132904</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Hour =
FORMAT(
    'Table'[Date],"hh")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Text =
[Hour] &amp;amp;":"&amp;amp;"00"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 =
var _table1=
{"Rollover"}
var _table2=
UNION(_table1,DISTINCT('Table'[Text]))
return
ADDCOLUMNS(
   _table2,"Rcvd QTY",
    IF(
       [Value]="Rollover",SUMX(ALL('Table'),[Value]),
    SUMX(FILTER(ALL('Table'),'Table'[Text]=EARLIER([Value])),[Value])))&lt;/LI-CODE&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 03:24:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3477739#M132904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-16T03:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Text and hour into a single column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3477895#M132914</link>
      <description>&lt;P&gt;hello Sir,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;i have tried the solution you provided but it returns a different outcome to what i am looking for, nonetheless good Sir, thank you for your time on this query.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 05:39:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Text-and-hour-into-a-single-column/m-p/3477895#M132914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-16T05:39:52Z</dc:date>
    </item>
  </channel>
</rss>

