Home > OS >  How to calculate how many sales are between datetimes in Power Query o Excel table
How to calculate how many sales are between datetimes in Power Query o Excel table

Time:11-17

if you are reading this, really appreciate it. So I need to figure out how to get an excel table that summarizes how many sales are in each hour of each day of the year. My idea is to make a table with a count.ifs column that count sales between two dates. But may be there is a better way than this. I get the source database trough power query conecction. I attach an image with the source database and other with the result table that I need. Thanks for helping, hope I explained well because I dont speak english a lot. Regards, Niko

DATA SOURCE enter image description here

RESULT TABLE

enter image description here

CodePudding user response:

If your data was loaded in PowerQuery (Data ... from table/range) then you could

click select FECHA and transform to date

click select HORA and transform to time

Pull out just the hour, ignoring minutes by Add column ... custom column ...named HOUR

= Time.Hour([HORA]))

Click select [FECHA] and [HOUR] columns, right click, group by..., and use SUM operation on the total column

File .. Close and load...

  • Related