Forum Discussion
Grouping date and time
- 4 years ago
if you just want to select the dates in your table (May skip Weekends, holidays ect)
Add Conditional Column to table in Power Query:
= Table.AddColumn(#"Renamed Columns", "Adj Date", each if [Time] >= #time(11, 0, 0) then [Date] else (Date.AddDays([Date],-1)))Create a Copy of your Table in Power Query name it Batch
Remove all Columns except for Adj Date
Remove duplicates
add index starting at 1 this will be your batch numberJoin to your financials table: [Adj Date] --> Batch Table: [Adj Date]
change index field to not summarize
you create a table 'Batches' which contains three columns [From], [To] and [Batch]
then the new calculated column in Table1 would be
MAXX (
FILTER ( Batches, Batches [From] <= Table1[Date] && Batches [To] > Table1[Date] ), Batches[Batch] )
Hi Tamerj,
thanks for your reply. I am looking for help on creating the logic for the Batch number. So the earliest date to next date is batch1 and so on.
- tamerj14 years agoCommunity Champion
Ok. Please share some sample data to understand how does it look like.