Power query Group table regarding date and hourly intervals

Sebastien Durandeau 1 Reputation point
2021-12-20T10:23:54.237+00:00

Dear all,
I need to group a table based on the date and the hourly interval:

  • Date
  • Interval: from 8am today to <8am today+1

Previously I was using MS Access and a query to create it. Now I need to go through Power Query in MS Excel.

That was the SQL Query used before:
*SELECT switch(Tbl_Prod_Chat.[Interval]>=8,Tbl_Prod_Chat.[Date],Tbl_Prod_Chat.[Interval]<8,Tbl_Prod_Chat.[Date]-1) AS LINK_DATE, Tbl_Prod_Chat.Agent, Sum(Tbl_Prod_Chat.ProdChat) AS Prod_Cha
FROM Tbl_Prod_Chat
GROUP BY Switch(Tbl_Prod_Chat.[Interval]>=8,Tbl_Prod_Chat.[Date],Tbl_Prod_Chat.[Interval]<8,Tbl_Prod_Chat.[Date]-1), Tbl_Prod_Chat.Agent;**

The table is built as:

  • Date (type/format: mm/dd/yyyy)
  • Interval (type: whole number): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0
  • Volume of contact (type: whole number)

Can you please help me on this?

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2021-12-20T13:00:21.573+00:00

    Power query is not currently supported here on Q&A. The product group for Power Query actively monitors questions over at
    https://community.powerbi.com/t5/Power-Query/bd-p/power-bi-services

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.