+ Reply to Thread
Results 1 to 6 of 6

Power Query calculate Count numbers by different dates

  1. #1
    Registered User
    Join Date
    01-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    54

    Power Query calculate Count numbers by different dates

    Greetings,
    I'm trying to figure out a method of checking the difference of counts that change by date.

    Example

    Source Query:
    Name Count Date
    John 20 12/24/2019

    Next Day Same Query:
    John 25 12/25/2019


    Output: As of 12/24/2019 John has 5 new....
    In a "Landing Table"

    Currently I have a source query From .csv: Connection only, Grouped by name, and Added Column "Count" and "Date" with DateTime.LocalNow() as datetime

    I'm stuck at a stageing table where i'm trying to add a condidintal column to check the source count and append any changes to the a "Landing Table"

    I also have been trgin to modify a fucntion i have that creates a running total here:

    Please Login or Register  to view this content.
    But i'm stummped or have been staring at the screen to long..

    Thanks for any help!

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Power Query calculate Count numbers by different dates

    An example of the actual data and expected results would help, that example you give doesn't make a lot of sense to me.

  3. #3
    Registered User
    Join Date
    01-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Power Query calculate Count numbers by different dates

    Considering they haven't been created yet I've attempted to replicate what i'd need on a workbook to simulates the Queries and end results
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Power Query calculate Count numbers by different dates

    Although this isn't done in Power Query, perhaps this will help:
    1. Convert the query runs today range into a table and append daily.
    2. Populate a fourth column in the table using: =IF([@Date]=TODAY(),"Today",IF([@Date]=TODAY()+1,"Tomorrow",""))
    3. Populate the Name column in the Change Report using: =IFERROR(INDEX(tbl_TodayQuery[Name],MATCH(0,INDEX(COUNTIF(K$2:K2,tbl_TodayQuery[Name]),,),)),"")
    4. Populate the As Of column using: =IF(K3="","",AGGREGATE(15,6,tbl_TodayQuery[Date]/(tbl_TodayQuery[Today/Tom]="Today"),1))
    5. Populate the Change column using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    01-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Power Query calculate Count numbers by different dates

    Hi Thank you for the resposne.
    I should have mentioned id prefere not to append the table maunally and i'd like to avoid generateing large tables.

    Also I was unable to download the file. Not sure if its a site issure or my browers atm.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Power Query calculate Count numbers by different dates

    I'd recommend uploading sample csv file(s), with desensitized data.

    And how you'd want the result to look like. Query sequence and dependency isn't clear to me from your sample.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Power Query - US and UK Dates
    By andrewc in forum Excel General
    Replies: 5
    Last Post: 11-12-2019, 03:14 PM
  2. [SOLVED] Power Query count rows
    By rs1aj in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-29-2019, 11:45 AM
  3. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  4. Power Query - Sum between dates formula explanation
    By AZ-XL in forum Excel General
    Replies: 1
    Last Post: 04-03-2018, 03:20 AM
  5. Replies: 15
    Last Post: 03-29-2018, 11:29 AM
  6. Power Query Duration Between Two Dates
    By mielkew27 in forum Excel General
    Replies: 3
    Last Post: 04-18-2017, 01:31 AM
  7. Power Query - Add dates to fixed Data set
    By happydays886 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2017, 10:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1